Commit ba421da 1 parent 63eb673 commit ba421da Copy full SHA for ba421da
File tree 3 files changed +4
-7
lines changed
3 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -312,6 +312,9 @@ def to_geojson(
312
312
) -> dict :
313
313
features = []
314
314
315
+ if type (location_response ["data" ]) is not list :
316
+ location_response ["data" ] = [location_response ["data" ]]
317
+
315
318
for location_feature in location_response ["data" ]:
316
319
# z = location_feature["attributes"]["elevation"]
317
320
# if z is not None:
Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ def locations(
97
97
else :
98
98
response = self .get_or_fetch_all_param_filtered_pages (select_properties )
99
99
100
+ # FROM SPEC: If a location id is not defined the API SHALL return a GeoJSON features array of valid location identifiers,
100
101
if not any ([crs , datetime_ , location_id ]) or format_ == "geojson" :
101
102
return LocationHelper .to_geojson (
102
103
response ,
Original file line number Diff line number Diff line change @@ -276,24 +276,17 @@ def test_fields_are_unique(self):
276
276
def test_cache (self ):
277
277
url = "https://data.usbr.gov/rise/api/catalog-item/128562"
278
278
279
- start = time .time ()
280
279
cache = RISECache ("redis" )
281
280
cache .clear (url )
282
281
remote_res = safe_run_async (cache .get_or_fetch (url ))
283
- assert remote_res
284
- network_time = time .time () - start
285
282
286
283
assert cache .contains (url )
287
284
288
- start = time .time ()
289
285
cache .clear (url )
290
286
assert not cache .contains (url )
291
287
disk_res = safe_run_async (cache .get_or_fetch (url ))
292
288
assert disk_res
293
- disk_time = time .time () - start
294
-
295
289
assert remote_res == disk_res
296
- assert disk_time < network_time
297
290
298
291
def test_cache_clears (self ):
299
292
cache = RISECache ("redis" )
You can’t perform that action at this time.
0 commit comments