diff --git a/tests/test_harmony.py b/tests/test_harmony.py index 5ebad213..e3997956 100644 --- a/tests/test_harmony.py +++ b/tests/test_harmony.py @@ -1,3 +1,4 @@ +from datetime import datetime import json from shutil import rmtree import sys @@ -6,7 +7,7 @@ from unittest.mock import patch from os import environ from pathlib import Path -from urllib.parse import urlsplit, unquote +from urllib.parse import urlsplit from netCDF4 import Dataset import pytest @@ -75,14 +76,13 @@ def test_service_invoke(self): self.assertEqual(item['bbox'], [-4, -3, 4, 3]) self.assertEqual(properties['start_datetime'], '2020-01-01T00:00:00+00:00') self.assertEqual(properties['end_datetime'], '2020-01-05T23:59:59+00:00') - # -- Asset Verification -- data = item['assets']['data'] collection_name = in_message['sources'][0]['collection'] # Sanity checks on metadata - 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.assertTrue(data['href'].endswith(f"{datetime.fromisoformat(properties['end_datetime']).strftime("%Y%m%dT%H%M%SZ")}_{collection_name}_merged.nc4")) + self.assertTrue(data['title'].endswith(f"{datetime.fromisoformat(properties['end_datetime']).strftime("%Y%m%dT%H%M%SZ")}_{collection_name}_merged.nc4")) self.assertEqual(data['type'], 'application/x-netcdf4') self.assertEqual(data['roles'], ['data'])