Skip to content

Commit 2cf2ec0

Browse files
committed
better provider test
1 parent a469bc6 commit 2cf2ec0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

rise/tests/test_provider.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ def edr_config():
2323

2424

2525
def test_location_locationId(edr_config: dict):
26+
includedItems = requests.get("https://data.usbr.gov/rise/api/location/1?include=catalogRecords.catalogItems").json()["included"]
27+
catalogItems = len([item["id"] for item in includedItems if item["type"] == "CatalogItem"])
28+
2629
p = RiseEDRProvider(edr_config)
2730
out = p.locations(location_id=1, format_="covjson")
28-
# Returns 3 since we have 3 parameters in the location
29-
assert len(out["coverages"]) == 3
31+
# Returns the same number of coverages as catalogItems
32+
assert len(out["coverages"]) == catalogItems
3033

3134
geojson_out: dict = p.locations(location_id=1, format_="geojson") # type: ignore For some reason mypy complains
3235
assert geojson_out["type"] == "Feature"

0 commit comments

Comments
 (0)