#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
test_patchio
----------------------------------

Tests for `patchio` module.
"""

import unittest

from patchio import patchio


class TestPatchio(unittest.TestCase):

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_000_something(self):
        pass


if __name__ == '__main__':
    import sys
    sys.exit(unittest.main())

@@ -141,16 +141,27 @@
 unittest
+%0Aimport sys
 %0A%0Afrom p
@@ -179,18 +179,21 @@
 rt patch
-io
+_args
 %0A%0A%0Aclass
@@ -202,18 +202,20 @@
 estPatch
-io
+Args
 (unittes
@@ -261,142 +261,1063 @@
     
-pass%0A%0A    def tearDown(self):%0A        pass%0A%0A    def test_000_something(self):%0A        pass%0A%0A%0Aif __name__ == '__main__':%0A    import sys
+self.args = %5B%22some_arg%22, %22another_arg%22%5D%0A%0A    def test_args_change_and_change_back(self):%0A        %22%22%22Using patch_args context manager temporarily changes sys.argv.%22%22%22%0A        original_args = sys.argv%0A        assert sys.argv != self.new_args%0A        with patch_args(self.new_args) as args:%0A            assert args is sys.argv is self.new_args%0A            assert sys.argv is not original_args%0A        assert sys.argv != self.new_args%0A        assert sys.argv is original_args%0A%0A    def test_decorator(self):%0A        %22%22%22Using patch_args decorator temporarily changes sys.argv.%22%22%22%0A        @patch_args(self.new_args)%0A        def my_func(yay):%0A            my_func.call_count += 1%0A            assert sys.argv is self.new_args%0A            assert sys.argv is not original_args%0A        my_func.call_count = 0%0A        original_args = sys.argv%0A        assert sys.argv != self.new_args%0A        my_func()%0A        my_func()%0A        assert my_func.call_count == 2%0A        assert sys.argv != self.new_args%0A        assert sys.argv is original_args%0A%0A%0Aif __name__ == '__main__':
 %0A   

Add initial patch_args tests