diff --git a/tests/collection_names.py b/tests/collection_names.py index 6070d999..409547e7 100644 --- a/tests/collection_names.py +++ b/tests/collection_names.py @@ -28,12 +28,24 @@ def main(): # Get providers providers = [] collections = [] + try: - with open(args.file, "r") as file: - collections_list = json.loads(file.read()) + with open(args.file, 'r') as file: + file_content = file.read() + if file_content: + collections_list = json.loads(file_content) + else: + collections_list = [] + except json.JSONDecodeError as e: + print(f"Failed to parse JSON: {e}") + print(f"Content of the file:\n {file_content}") + raise e except FileNotFoundError: print(f"Error: File '{args.file}' not found.") return + except Exception as e: + print(f"An unexpected error occurred: {e}") + raise e for collection in collections_list: provider = collection.split('-')[1] diff --git a/tests/get_associations.py b/tests/get_associations.py index 3e31a4c7..8e7c67e9 100644 --- a/tests/get_associations.py +++ b/tests/get_associations.py @@ -50,7 +50,7 @@ def get_associations(token, env): } service_concept_id = cmr.queries.ServiceQuery(mode=mode).provider('POCLOUD').name('PODAAC Concise').get()[0].get('concept_id') - url = cmr.queries.CollectionQuery(mode=mode).service_concept_id(service_concept_id).provider('POCLOUD')._build_url() + url = cmr.queries.CollectionQuery(mode=mode).service_concept_id(service_concept_id)._build_url() collections_query = requests.get(url, headers=headers, params={'page_size': 2000}).json()['feed']['entry'] collections = [a.get('id') for a in collections_query] diff --git a/tests/test_dir/20000224000006-JPL-L2P_GHRSST-SSTskin-MODIS_T-N-v02.0-fv01.0.nc b/tests/test_dir/20000224000006-JPL-L2P_GHRSST-SSTskin-MODIS_T-N-v02.0-fv01.0.nc new file mode 100644 index 00000000..2cc9d5c6 Binary files /dev/null and b/tests/test_dir/20000224000006-JPL-L2P_GHRSST-SSTskin-MODIS_T-N-v02.0-fv01.0.nc differ diff --git a/tests/test_dir/20000224000506-JPL-L2P_GHRSST-SSTskin-MODIS_T-D-v02.0-fv01.0.nc b/tests/test_dir/20000224000506-JPL-L2P_GHRSST-SSTskin-MODIS_T-D-v02.0-fv01.0.nc new file mode 100644 index 00000000..6fc3e9f3 Binary files /dev/null and b/tests/test_dir/20000224000506-JPL-L2P_GHRSST-SSTskin-MODIS_T-D-v02.0-fv01.0.nc differ