def test_copy_folder_to_folder(self): vfs.copy('tests', 'tmp') file = vfs.open('tmp/tests/hello.txt') try: self.assertEqual(file.read(), 'hello world\n') finally: file.close()
def test_copy_file(self): vfs.copy('tests/hello.txt', 'tmp/hello.txt.bak') file = vfs.open('tmp/hello.txt.bak') try: self.assertEqual(file.read(), 'hello world\n') finally: file.close()
def test17_move_file(self): vfs.copy('tests/hello.txt', 'tests/hello.txt.bak') vfs.move('tests/hello.txt.bak', 'tests/hello.txt.old') file = vfs.open('tests/hello.txt.old') self.assertEqual(file.read(), 'hello world\n') self.assertEqual(vfs.exists('tests/hello.txt.bak'), False)