Lines Matching +full:module +full:- +full:path +full:- +full:tests
5 The ``fake_filesystem_unittest`` module automatically finds all real file
9 - ``example.py`` is the software under test. In production, it uses the
11 - ``example_test.py`` tests ``example.py``. During testing, the pyfakefs fake
14 .. note:: This example uses the Python ``unittest`` module for testing, but the
20 -------------------
25 def create_file(path):
32 >>> os.path.isdir('/test')
35 >>> os.path.isdir('/test')
37 >>> os.path.exists('/test/file.txt')
40 >>> os.path.exists('/test/file.txt')
46 with open(path, "w") as f:
47 f.write("This is test file '{}'.\n".format(path))
54 Unit Tests and Doctests
55 -----------------------
56 ``example_test.py`` contains unit tests for ``example.py``. ``example.py``
59 The module ``fake_filesystem_unittest`` contains code that finds all real file
69 # The module under test is example:
79 def load_tests(loader, tests, ignore):
80 """Load the pyfakefs/example.py doctest tests into unittest."""
81 return fake_filesystem_unittest.load_doctests(loader, tests, ignore, example)
107 # The os module has been replaced with the fake os module so all of the
109 self.assertFalse(os.path.isdir("/test"))
111 self.assertTrue(os.path.isdir("/test"))
113 self.assertFalse(os.path.exists("/test/file.txt"))
115 self.assertTrue(os.path.exists("/test/file.txt"))
121 ``tearDown()``. Write your tests as usual. From ``self.setUpPyfakefs()`` to