@@ -279,12 +279,28 @@ def test_delete(con100, requests_mock):
279279 assert adapter .called
280280
281281
282- def test_build_parameterized_cube_basic (con100 , recwarn ):
283- layer = Parameter .string ("layer" , description = "Collection Id" )
284- dates = Parameter .string ("dates" , description = "Temporal extent" )
285- bbox = Parameter ("bbox" , schema = "object" , description = "bbox" )
282+ @pytest .mark .parametrize (
283+ ["layer" , "dates" , "bbox" ],
284+ [
285+ (
286+ Parameter .string ("layer" , description = "Collection Id" ),
287+ Parameter .string ("dates" , description = "Temporal extent" ),
288+ Parameter ("bbox" , schema = "object" , description = "bbox" ),
289+ ),
290+ (
291+ Parameter .string ("layer" , description = "Collection Id" ),
292+ Parameter .temporal_interval (name = "dates" ),
293+ Parameter .spatial_extent (name = "bbox" ),
294+ ),
295+ (
296+ Parameter .string ("layer" , description = "Collection Id" ),
297+ Parameter .temporal_interval (name = "dates" ),
298+ Parameter .bounding_box (name = "bbox" ),
299+ ),
300+ ],
301+ )
302+ def test_build_parameterized_cube_filters (con100 , layer , dates , bbox , recwarn ):
286303 cube = con100 .load_collection (layer ).filter_temporal (dates ).filter_bbox (bbox )
287-
288304 assert cube .flat_graph () == {
289305 "loadcollection1" : {
290306 "process_id" : "load_collection" ,
@@ -353,12 +369,28 @@ def test_build_parameterized_cube_start_date(con100, recwarn):
353369 assert recwarn .list == []
354370
355371
356- def test_build_parameterized_cube_load_collection (con100 , recwarn ):
357- layer = Parameter .string ("layer" , description = "Collection id" )
358- dates = Parameter .string ("dates" , description = "temporal extent" )
359- bbox = Parameter ("bbox" , schema = "object" , description = "bbox" )
372+ @pytest .mark .parametrize (
373+ ["layer" , "dates" , "bbox" ],
374+ [
375+ (
376+ Parameter .string ("layer" , description = "Collection Id" ),
377+ Parameter .string ("dates" , description = "Temporal extent" ),
378+ Parameter ("bbox" , schema = "object" , description = "bbox" ),
379+ ),
380+ (
381+ Parameter .string ("layer" , description = "Collection Id" ),
382+ Parameter .temporal_interval (name = "dates" ),
383+ Parameter .spatial_extent (name = "bbox" ),
384+ ),
385+ (
386+ Parameter .string ("layer" , description = "Collection Id" ),
387+ Parameter .temporal_interval (name = "dates" ),
388+ Parameter .bounding_box (name = "bbox" ),
389+ ),
390+ ],
391+ )
392+ def test_build_parameterized_cube_load_collection (con100 , recwarn , layer , dates , bbox ):
360393 cube = con100 .load_collection (layer , spatial_extent = bbox , temporal_extent = dates )
361-
362394 assert cube .flat_graph () == {
363395 "loadcollection1" : {
364396 "process_id" : "load_collection" ,
@@ -379,7 +411,7 @@ def test_build_parameterized_cube_load_collection_invalid_bbox_schema(con100):
379411 bbox = Parameter .string ("bbox" , description = "Spatial extent" )
380412 with pytest .warns (
381413 UserWarning ,
382- match = "Unexpected parameterized `spatial_extent` in `load_collection`: expected schema with type 'object' but got {'type': 'string'}." ,
414+ match = "Unexpected parameterized `spatial_extent` in `load_collection`: expected schema compatible with type 'object' but got {'type': 'string'}." ,
383415 ):
384416 cube = con100 .load_collection (layer , spatial_extent = bbox , temporal_extent = dates )
385417
@@ -401,7 +433,7 @@ def test_build_parameterized_cube_filter_bbox_invalid_schema(con100):
401433 bbox = Parameter .string ("bbox" , description = "Spatial extent" )
402434 with pytest .warns (
403435 UserWarning ,
404- match = "Unexpected parameterized `extent` in `filter_bbox`: expected schema with type 'object' but got {'type': 'string'}." ,
436+ match = "Unexpected parameterized `extent` in `filter_bbox`: expected schema compatible with type 'object' but got {'type': 'string'}." ,
405437 ):
406438 cube = con100 .load_collection (layer ).filter_bbox (bbox )
407439
0 commit comments