diff --git a/mdps_ds_lib/stage_in_out/download_granules_abstract.py b/mdps_ds_lib/stage_in_out/download_granules_abstract.py index 749ef87..4b1f846 100644 --- a/mdps_ds_lib/stage_in_out/download_granules_abstract.py +++ b/mdps_ds_lib/stage_in_out/download_granules_abstract.py @@ -137,9 +137,7 @@ def download(self, **kwargs) -> str: catalog = Catalog( id='NA', description='NA') - catalog.set_self_href(os.path.join(self._download_dir, 'catalog.json')) - # catalog.add_link(Link('item', failed_features_file, 'application/json')) - + catalog.add_link(Link('root', f'catalog.json', 'application/json')) if len(self._granules_json.items) < 1: LOGGER.warning(f'cannot find any granules') granules_json_dict = self._granules_json.to_dict(False) diff --git a/tests/integration_tests/test_docker_stage_in.py b/tests/integration_tests/test_docker_stage_in.py index ff00423..9f177a4 100644 --- a/tests/integration_tests/test_docker_stage_in.py +++ b/tests/integration_tests/test_docker_stage_in.py @@ -1920,6 +1920,7 @@ def test_02_download__from_http_with_role(self): catalog_result = FileUtils.read_json(f'{downloading_dir}/catalog.json') print(catalog_result) catalog_result = Catalog.from_dict(catalog_result) + self.assertEqual(catalog_result.links[0].href, 'catalog.json', f'wrong root: {catalog_result.links[0]}') for each in catalog_result.links[1:]: print(FileUtils.read_json(f'{downloading_dir}/{each.href}')) for each_granule in zip(granule_json['features'], download_result):