コード例 #1
0
    def test_file_exists(self):
        '''Test example.path_exists()

        `self.fs.CreateFile()` is convenient because it automatically creates
        directories in the fake file system and allows you to specify the file
        contents.
        
        You could also use `open()` or `file()` if you wanted.
        '''
        self.assertFalse(example.path_exists('/test/empty.txt'))
        self.fs.CreateFile('/test/empty.txt')
        self.assertTrue(example.path_exists('/test/empty.txt'))
コード例 #2
0
ファイル: example_test.py プロジェクト: atbrox/pyfakefs
    def test_file_exists(self):
        '''Test example.path_exists()

        `self.fs.CreateFile()` is convenient because it automatically creates
        directories in the fake file system and allows you to specify the file
        contents.
        
        You could also use `open()` or `file()` if you wanted.
        '''
        self.assertFalse(example.path_exists('/test/empty.txt'))          
        self.fs.CreateFile('/test/empty.txt')
        self.assertTrue(example.path_exists('/test/empty.txt'))              
コード例 #3
0
 def test_file_exists(self):
     """Test example.path_exists() which uses `os.path.exists()`."""
     self.assertFalse(example.path_exists('/test/empty.txt'))
     self.fs.CreateFile('/test/empty.txt')
     self.assertTrue(example.path_exists('/test/empty.txt'))