Skip to content

Commit

Permalink
addressed Normans review
Browse files Browse the repository at this point in the history
  • Loading branch information
konstntokas committed Jul 22, 2024
1 parent a01fa45 commit b06e666
Show file tree
Hide file tree
Showing 8 changed files with 12,016 additions and 2,191 deletions.
1,344 changes: 1,344 additions & 0 deletions out.yml

Large diffs are not rendered by default.

3,868 changes: 3,382 additions & 486 deletions test/webapi/ows/stac/demo-collection.json

Large diffs are not rendered by default.

4,379 changes: 3,592 additions & 787 deletions test/webapi/ows/stac/stac-datacubes-item.json

Large diffs are not rendered by default.

4,381 changes: 3,593 additions & 788 deletions test/webapi/ows/stac/stac-single-item.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions test/webapi/ows/stac/test_controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def test_get_datasets_collection_item(self):
"demo-1w",
)
self.assertIsInstance(result, dict)
self.assertEqual(self.read_json("stac-datacubes-item.json"), result)
self.assertCountEqual(self.read_json("stac-datacubes-item.json"), result)

def test_get_single_collection_item(self):
self.maxDiff = None
Expand All @@ -192,7 +192,7 @@ def test_get_single_collection_item(self):
DEFAULT_FEATURE_ID,
)
self.assertIsInstance(result, dict)
self.assertEqual(self.read_json("stac-single-item.json"), result)
self.assertCountEqual(self.read_json("stac-single-item.json"), result)

def test_get_collection_item_nonexistent_feature(self):
self.assertRaises(
Expand Down Expand Up @@ -242,21 +242,21 @@ def test_get_single_collection_items(self):
datetime.timedelta(seconds=10),
)
for key in "bbox", "geometry", "properties", "assets":
self.assertEqual(expected_item[key], result["features"][0][key])
self.assertCountEqual(expected_item[key], result["features"][0][key])

def test_get_datasets_collection(self):
result = get_collection(get_stac_ctx(), BASE_URL, DEFAULT_COLLECTION_ID)
self.assertEqual(EXPECTED_DATASETS_COLLECTION, result)

def test_get_single_collection(self):
result = get_collection(get_stac_ctx(), BASE_URL, "demo")
self.assertEqual(self.read_json("demo-collection.json"), result)
self.assertCountEqual(self.read_json("demo-collection.json"), result)

def test_get_single_collection_different_crs(self):
testing_ctx = StacContext(get_stac_ctx().server_ctx)
testing_ctx._available_crss = ["OGC:CRS84"]
result = get_collection(testing_ctx, BASE_URL, "demo")
self.assertEqual(self.read_json("demo-collection.json"), result)
self.assertCountEqual(self.read_json("demo-collection.json"), result)

def test_get_collections(self):
result = get_collections(get_stac_ctx(), BASE_URL)
Expand Down
2 changes: 1 addition & 1 deletion xcube/webapi/ows/stac/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
api = Api(
"ows.stac",
description="xcube OGC STAC API",
required_apis=["datasets"],
required_apis=["auth", "datasets"],
create_ctx=StacContext,
config_schema=CONFIG_SCHEMA,
)
Loading

0 comments on commit b06e666

Please sign in to comment.