Skip to content

Commit

Permalink
change from isoformat extended to basic, and remove url parsing in test
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfromearth committed Nov 8, 2024
1 parent cdff762 commit ac968de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion podaac/merger/harmony/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def process_catalog(self, catalog: Catalog):
first_granule_url = []
get_granule_url(items[0], first_granule_url)
first_url_name = Path(first_granule_url[0]).stem
filename = f'{first_url_name}_{datetimes[1].isoformat()}_{collection}_merged.nc4'
filename = f'{first_url_name}_{datetimes[1].strftime("%Y%m%dT%H%M%SZ")}_{collection}_merged.nc4'

with TemporaryDirectory() as temp_dir:
self.logger.info('Starting granule downloads')
Expand Down
6 changes: 3 additions & 3 deletions tests/test_harmony.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ def test_service_invoke(self):
collection_name = in_message['sources'][0]['collection']

# Sanity checks on metadata
self.assertTrue(unquote(data['href'], encoding='utf-8', errors='replace').endswith(f"{properties['end_datetime']}_{collection_name}_merged.nc4"))
self.assertTrue(unquote(data['title'], encoding='utf-8', errors='replace').endswith(f"{properties['end_datetime']}_{collection_name}_merged.nc4"))
self.assertTrue(data['href'].endswith(f"{properties['end_datetime']}_{collection_name}_merged.nc4"))
self.assertTrue(data['title'].endswith(f"{properties['end_datetime']}_{collection_name}_merged.nc4"))
self.assertEqual(data['type'], 'application/x-netcdf4')
self.assertEqual(data['roles'], ['data'])

Expand All @@ -96,7 +96,7 @@ def test_service_invoke(self):
]

path = urlsplit(data['href']).path
dataset = Dataset(unquote(path, encoding='utf-8', errors='replace'))
dataset = Dataset(path)
subset_files = dataset['subset_files'][:].tolist()
subset_files.sort()

Expand Down

0 comments on commit ac968de

Please sign in to comment.