Example #1
0
 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()
Example #2
0
 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()
Example #3
0
 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()
Example #4
0
 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()
Example #5
0
 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)
Example #6
0
 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)