Example #1
0
 def move(self, dest):
     """
     Moves file to dest
     :param dest: path to destination file
     :type dest: str
     """
     self._assert_exists_()
     fs.move(self.path, dest).if_failed_raise(
         CommandException("Cannot copy '{path}' to {dst}".format(
             path=self.path, dst=dest)))
Example #2
0
File: hdfs.py Project: epam/Merlin
 def move(self, dest):
     """
     Moves file to dest
     :param dest: path to destination file
     :type dest: str
     """
     self._assert_exists_()
     fs.move(self.path, dest).if_failed_raise(
         CommandException("Cannot copy '{path}' to {dst}".format(path=self.path, dst=dest))
     )
Example #3
0
    def test_move_command_generator(self):
        hdfs_client.move(
            files="/tmp/data.txt",
            dest="/raw/dir",
            executor=lambda cmd, *args: self._assert_command_generation(
                "hadoop fs -mv /tmp/data.txt /raw/dir")(cmd, *args))

        hdfs_client.move(
            files=["/tmp/file_001.txt", "/tmp/file_002.txt"],
            dest="/raw/dir",
            executor=lambda cmd, *args: self._assert_command_generation(
                "hadoop fs -mv /tmp/file_001.txt /tmp/file_002.txt /raw/dir")
            (cmd, *args))
Example #4
0
    def test_move_command_generator(self):
        hdfs_client.move(
            files="/tmp/data.txt",
            dest="/raw/dir",
            executor=lambda cmd, *args: self._assert_command_generation("hadoop fs -mv /tmp/data.txt /raw/dir")(
                cmd, *args
            ),
        )

        hdfs_client.move(
            files=["/tmp/file_001.txt", "/tmp/file_002.txt"],
            dest="/raw/dir",
            executor=lambda cmd, *args: self._assert_command_generation(
                "hadoop fs -mv /tmp/file_001.txt /tmp/file_002.txt /raw/dir"
            )(cmd, *args),
        )