Commit 2cf2ec0 1 parent a469bc6 commit 2cf2ec0 Copy full SHA for 2cf2ec0
File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,13 @@ def edr_config():
23
23
24
24
25
25
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
+
26
29
p = RiseEDRProvider (edr_config )
27
30
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
30
33
31
34
geojson_out : dict = p .locations (location_id = 1 , format_ = "geojson" ) # type: ignore For some reason mypy complains
32
35
assert geojson_out ["type" ] == "Feature"
You can’t perform that action at this time.
0 commit comments