Skip to content

Commit ebdb5bc

Browse files
authored
fix: Stage in root url relative (#63)
* feat: add AUDIT log level for upload * chore: update outdated tests * fix: allow empty str as RESULT_PATH_PREFIX & replace w/ default val * fix: root href is relative now
1 parent 295d47a commit ebdb5bc

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

mdps_ds_lib/stage_in_out/download_granules_abstract.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,7 @@ def download(self, **kwargs) -> str:
137137
catalog = Catalog(
138138
id='NA',
139139
description='NA')
140-
catalog.set_self_href(os.path.join(self._download_dir, 'catalog.json'))
141-
# catalog.add_link(Link('item', failed_features_file, 'application/json'))
142-
140+
catalog.add_link(Link('root', f'catalog.json', 'application/json'))
143141
if len(self._granules_json.items) < 1:
144142
LOGGER.warning(f'cannot find any granules')
145143
granules_json_dict = self._granules_json.to_dict(False)

tests/integration_tests/test_docker_stage_in.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,6 +1920,7 @@ def test_02_download__from_http_with_role(self):
19201920
catalog_result = FileUtils.read_json(f'{downloading_dir}/catalog.json')
19211921
print(catalog_result)
19221922
catalog_result = Catalog.from_dict(catalog_result)
1923+
self.assertEqual(catalog_result.links[0].href, 'catalog.json', f'wrong root: {catalog_result.links[0]}')
19231924
for each in catalog_result.links[1:]:
19241925
print(FileUtils.read_json(f'{downloading_dir}/{each.href}'))
19251926
for each_granule in zip(granule_json['features'], download_result):

0 commit comments

Comments
 (0)