Ejemplo n.º 1
0
 def test_move_empty_dir(self):
     _dir = HDFS(os.path.join("/tmp", str(uuid.uuid4())))
     dst = HDFS("/tmp/dst_" + str(uuid.uuid4()))
     try:
         _dir.create(directory=True)
         self.assertTrue(_dir.exists(), "directory not found")
         self.assertFalse(dst.exists(), "destination directory is already exists")
         _dir.move(dst.path)
         self.assertFalse(_dir.exists(), "Original directory was not removed")
         self.assertTrue(dst.exists(), "destination directory was not created")
     finally:
         _dir.delete(True)
         dst.delete(True)
         self.assertFalse(_dir.exists(), "File was not deleted")
         self.assertFalse(dst.exists(), "File was not deleted")
Ejemplo n.º 2
0
 def test_move_empty_dir(self):
     _dir = HDFS(os.path.join("/tmp", str(uuid.uuid4())))
     dst = HDFS("/tmp/dst_" + str(uuid.uuid4()))
     try:
         _dir.create(directory=True)
         self.assertTrue(_dir.exists(), "directory not found")
         self.assertFalse(dst.exists(), "destination directory is already exists")
         _dir.move(dst.path)
         self.assertFalse(_dir.exists(), "Original directory was not removed")
         self.assertTrue(dst.exists(), "destination directory was not created")
     finally:
         _dir.delete(True)
         dst.delete(True)
         self.assertFalse(_dir.exists(), "File was not deleted")
         self.assertFalse(dst.exists(), "File was not deleted")
Ejemplo n.º 3
0
 def test_move_file(self):
     _file = HDFS(os.path.join("/tmp", str(uuid.uuid4())))
     dst = HDFS(os.path.join("/tmp", str(uuid.uuid4())))
     try:
         _file.create_file()
         self.assertTrue(_file.exists(), "File was not created")
         self.assertFalse(dst.exists(), "Destination file should not exist")
         _file.move(dst.path)
         self.assertFalse(_file.exists(), "Original file should be deleted")
         self.assertTrue(dst.exists(), "Destination file should be created")
     finally:
         _file.delete()
         dst.delete()
         self.assertFalse(_file.exists(), "File was not deleted")
         self.assertFalse(dst.exists(), "destination file was not deleted")
Ejemplo n.º 4
0
 def test_move_file(self):
     _file = HDFS(os.path.join("/tmp", str(uuid.uuid4())))
     dst = HDFS(os.path.join("/tmp", str(uuid.uuid4())))
     try:
         _file.create_file()
         self.assertTrue(_file.exists(), "File was not created")
         self.assertFalse(dst.exists(), "Destination file should not exist")
         _file.move(dst.path)
         self.assertFalse(_file.exists(), "Original file should be deleted")
         self.assertTrue(dst.exists(), "Destination file should be created")
     finally:
         _file.delete()
         dst.delete()
         self.assertFalse(_file.exists(), "File was not deleted")
         self.assertFalse(dst.exists(), "destination file was not deleted")