def test_copy_to_local_command_generator(self): hdfs_client.copy_to_local( path="/tmp/test", localdst="~/dir", executor=lambda command, *args: self.assertEqual( build_command(command, *args), "hadoop fs -copyToLocal /tmp/test ~/dir"))
def test_copy_to_local_command_generator(self): hdfs_client.copy_to_local( path="/tmp/test", localdst="~/dir", executor=lambda command, *args: self.assertEqual( build_command(command, *args), "hadoop fs -copyToLocal /tmp/test ~/dir" ), )
def copy_to_local(self, local_path): """ Copies file from HDFS to the local file system :param local_path: path to file on local file system :type local_path: str """ self._assert_exists_() fs.copy_to_local(path=self.path, localdst=local_path).if_failed_raise( CommandException( "Cannot copy '{path}' to local".format(path=self.path)))
def copy_to_local(self, local_path): """ Copies file from HDFS to the local file system :param local_path: path to file on local file system :type local_path: str """ self._assert_exists_() fs.copy_to_local(path=self.path, localdst=local_path).if_failed_raise( CommandException("Cannot copy '{path}' to local".format(path=self.path)) )