2424
2525def test_build_request_success (geom_geojson ):
2626 source = {
27- "type" : "catalog" ,
2827 "parameters" : {
2928 "geometry" : geom_geojson ,
3029 "start_time" : "2021-03-01T00:00:00Z" ,
@@ -69,7 +68,6 @@ def test_build_request_success(geom_geojson):
6968def test_build_request_clip_to_source_success (geom_geojson ):
7069 """Without a clip tool we can clip to source."""
7170 source = {
72- "type" : "catalog" ,
7371 "parameters" : {
7472 "geometry" : geom_geojson ,
7573 "start_time" : "2021-03-01T00:00:00Z" ,
@@ -95,7 +93,6 @@ def test_build_request_clip_to_source_success(geom_geojson):
9593def test_build_request_clip_to_source_failure (geom_geojson ):
9694 """With a clip tool we can not clip to source."""
9795 source = {
98- "type" : "catalog" ,
9996 "parameters" : {
10097 "geometry" : geom_geojson ,
10198 "start_time" : "2021-03-01T00:00:00Z" ,
@@ -121,7 +118,6 @@ def test_build_request_clip_to_source_failure(geom_geojson):
121118
122119def test_build_request_host_sentinel_hub_no_collection (geom_geojson ):
123120 source = {
124- "type" : "catalog" ,
125121 "parameters" : {
126122 "geometry" : geom_geojson ,
127123 "start_time" : "2021-03-01T00:00:00Z" ,
@@ -145,7 +141,6 @@ def test_build_request_host_sentinel_hub_no_collection(geom_geojson):
145141
146142def test_build_request_host_sentinel_hub_with_collection (geom_geojson ):
147143 source = {
148- "type" : "catalog" ,
149144 "parameters" : {
150145 "geometry" : geom_geojson ,
151146 "start_time" : "2021-03-01T00:00:00Z" ,
@@ -174,7 +169,6 @@ def test_build_request_host_sentinel_hub_with_collection(geom_geojson):
174169
175170def test_build_request_host_sentinel_hub_create_configuration (geom_geojson ):
176171 source = {
177- "type" : "catalog" ,
178172 "parameters" : {
179173 "geometry" : geom_geojson ,
180174 "start_time" : "2021-03-01T00:00:00Z" ,
@@ -203,7 +197,6 @@ def test_build_request_host_sentinel_hub_create_configuration(geom_geojson):
203197def test_build_request_host_sentinel_hub_collection_configuration (
204198 geom_geojson ):
205199 source = {
206- "type" : "catalog" ,
207200 "parameters" : {
208201 "geometry" : geom_geojson ,
209202 "start_time" : "2021-03-01T00:00:00Z" ,
@@ -242,7 +235,6 @@ def test_catalog_source_success(geom_geojson, mock_bundles):
242235 )
243236
244237 expected = {
245- "type" : "catalog" ,
246238 "parameters" : {
247239 "geometry" : geom_geojson ,
248240 "start_time" : "2021-03-01T00:00:00Z" ,
@@ -270,7 +262,6 @@ def test_catalog_source_featurecollection(featurecollection_geojson,
270262 )
271263
272264 expected = {
273- "type" : "catalog" ,
274265 "parameters" : {
275266 "geometry" : geom_geojson ,
276267 "start_time" : "2021-03-01T00:00:00Z" ,
@@ -558,6 +549,7 @@ def test_toar_tool_success():
558549 [
559550 ("biomass_proxy" , "BIOMASS-PROXY_V3.0_10" ), # actual real type and id.
560551 ("var1" , "VAR1-ABCD" ), # nonsense type and id
552+ (None , "BIOMASS-PROXY_V3.0_10" ), # None type with valid id
561553 ])
562554def test_pv_source_success (geom_geojson , var_type , var_id ):
563555 """Configure a planetary variable subscription source."""
@@ -569,7 +561,10 @@ def test_pv_source_success(geom_geojson, var_type, var_id):
569561 end_time = datetime (2021 , 3 , 2 ),
570562 )
571563
572- assert source ["type" ] == var_type
564+ if var_type :
565+ assert source ["type" ] == var_type
566+ else :
567+ assert "type" not in source
573568 params = source ["parameters" ]
574569 assert params ["id" ] == var_id
575570 assert params ["geometry" ] == geom_geojson
0 commit comments