Skip to content

Commit

Permalink
Feature/fix remove old pr (#1020)
Browse files Browse the repository at this point in the history
* test

* update collection names

* remove loggings

* update tests
  • Loading branch information
sliu008 authored Oct 3, 2024
1 parent 8f19633 commit 78a8e58
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions tests/collection_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion tests/get_associations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
Binary file not shown.
Binary file not shown.

0 comments on commit 78a8e58

Please sign in to comment.