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)))
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)) )
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))
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), )