Skip to content

Commit

Permalink
Declare 'arrivals' a catalog, validate it.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyh committed Sep 20, 2021
1 parent 0af911c commit e4920d2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions cubedash/_stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ def arrivals():
dict(
id="Arrivals",
title="Dataset Arrivals",
type="Catalog",
license="various",
description="The most recently added Items to this index",
properties={},
Expand Down
16 changes: 16 additions & 0 deletions integration_tests/test_stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,22 @@ def test_stac_collections(stac_client: FlaskClient):
)


def test_arrivals_page_validation(stac_client: FlaskClient):
# Does the virtual 'arrivals' catalog validate?
# (this is actually not tested in the above root-catalog, surprisingly, as it has no expected dataset count.)
arrivals_collection = get_json(stac_client, "/stac/arrivals")
_CATALOG_SCHEMA.validate(arrivals_collection)

[items_page_url] = [
i["href"] for i in arrivals_collection["links"] if i["rel"] == "items"
]

# Get and validate items.
response = get_items(stac_client, items_page_url)
# Sanity check.
assert len(response["features"]) == OUR_PAGE_SIZE


def test_stac_collection_items(stac_client: FlaskClient):
"""
Follow the links to the "high_tide_comp_20p" collection and ensure it includes
Expand Down

0 comments on commit e4920d2

Please sign in to comment.