Skip to content

Commit

Permalink
fix: add mock url if url_path is misisng
Browse files Browse the repository at this point in the history
  • Loading branch information
wphyojpl committed Sep 8, 2022
1 parent b2bbd42 commit 347121d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def to_stac(self, source: dict) -> dict:
"totalGranules": [source['total_size'] if 'total_size' in source else -1],
},
"links": [self.__convert_to_stac_links({
"regex": source['url_path'],
"regex": source['url_path'] if 'url_path' in source else './collection.json',
"sampleFileName": source['sampleFileName'],
"type": "application/json",

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def test_01(self):
def test_02(self):
lambda_prefix = 'am-uds-dev-cumulus'
collection_query = CollectionsQuery('NA', 'NA')

collection_query.with_limit(2)
collections = collection_query.query_direct_to_private_api(lambda_prefix)
self.assertTrue('results' in collections, f'results not in collections: {collections}')
self.assertEqual(2, len(collections['results']), f'wrong length: {collections}')
return

0 comments on commit 347121d

Please sign in to comment.