def _download_file_based_fw_to(self, target_file): """File based firmware file downloader (copier) It copies the file (url) to temporary location (file location). Original firmware file location (url) is expected in the format "file:///tmp/.." :param target_file: destination file for copying the original firmware file. :raises: ImageDownloadFailed, on failure to copy the original file. """ src_file = self.parsed_url.path with open(target_file, 'wb') as fd: image_service.FileImageService().download(src_file, fd)
def setUp(self): super(FileImageServiceTestCase, self).setUp() self.service = image_service.FileImageService() self.href = 'file:///home/user/image.qcow2' self.href_path = '/home/user/image.qcow2'