Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 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)
Exemplo n.º 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)