24
24
25
25
def test_build_request_success (geom_geojson ):
26
26
source = {
27
- "type" : "catalog" ,
28
27
"parameters" : {
29
28
"geometry" : geom_geojson ,
30
29
"start_time" : "2021-03-01T00:00:00Z" ,
@@ -69,7 +68,6 @@ def test_build_request_success(geom_geojson):
69
68
def test_build_request_clip_to_source_success (geom_geojson ):
70
69
"""Without a clip tool we can clip to source."""
71
70
source = {
72
- "type" : "catalog" ,
73
71
"parameters" : {
74
72
"geometry" : geom_geojson ,
75
73
"start_time" : "2021-03-01T00:00:00Z" ,
@@ -95,7 +93,6 @@ def test_build_request_clip_to_source_success(geom_geojson):
95
93
def test_build_request_clip_to_source_failure (geom_geojson ):
96
94
"""With a clip tool we can not clip to source."""
97
95
source = {
98
- "type" : "catalog" ,
99
96
"parameters" : {
100
97
"geometry" : geom_geojson ,
101
98
"start_time" : "2021-03-01T00:00:00Z" ,
@@ -121,7 +118,6 @@ def test_build_request_clip_to_source_failure(geom_geojson):
121
118
122
119
def test_build_request_host_sentinel_hub_no_collection (geom_geojson ):
123
120
source = {
124
- "type" : "catalog" ,
125
121
"parameters" : {
126
122
"geometry" : geom_geojson ,
127
123
"start_time" : "2021-03-01T00:00:00Z" ,
@@ -145,7 +141,6 @@ def test_build_request_host_sentinel_hub_no_collection(geom_geojson):
145
141
146
142
def test_build_request_host_sentinel_hub_with_collection (geom_geojson ):
147
143
source = {
148
- "type" : "catalog" ,
149
144
"parameters" : {
150
145
"geometry" : geom_geojson ,
151
146
"start_time" : "2021-03-01T00:00:00Z" ,
@@ -174,7 +169,6 @@ def test_build_request_host_sentinel_hub_with_collection(geom_geojson):
174
169
175
170
def test_build_request_host_sentinel_hub_create_configuration (geom_geojson ):
176
171
source = {
177
- "type" : "catalog" ,
178
172
"parameters" : {
179
173
"geometry" : geom_geojson ,
180
174
"start_time" : "2021-03-01T00:00:00Z" ,
@@ -203,7 +197,6 @@ def test_build_request_host_sentinel_hub_create_configuration(geom_geojson):
203
197
def test_build_request_host_sentinel_hub_collection_configuration (
204
198
geom_geojson ):
205
199
source = {
206
- "type" : "catalog" ,
207
200
"parameters" : {
208
201
"geometry" : geom_geojson ,
209
202
"start_time" : "2021-03-01T00:00:00Z" ,
@@ -242,7 +235,6 @@ def test_catalog_source_success(geom_geojson, mock_bundles):
242
235
)
243
236
244
237
expected = {
245
- "type" : "catalog" ,
246
238
"parameters" : {
247
239
"geometry" : geom_geojson ,
248
240
"start_time" : "2021-03-01T00:00:00Z" ,
@@ -270,7 +262,6 @@ def test_catalog_source_featurecollection(featurecollection_geojson,
270
262
)
271
263
272
264
expected = {
273
- "type" : "catalog" ,
274
265
"parameters" : {
275
266
"geometry" : geom_geojson ,
276
267
"start_time" : "2021-03-01T00:00:00Z" ,
@@ -558,6 +549,7 @@ def test_toar_tool_success():
558
549
[
559
550
("biomass_proxy" , "BIOMASS-PROXY_V3.0_10" ), # actual real type and id.
560
551
("var1" , "VAR1-ABCD" ), # nonsense type and id
552
+ (None , "BIOMASS-PROXY_V3.0_10" ), # None type with valid id
561
553
])
562
554
def test_pv_source_success (geom_geojson , var_type , var_id ):
563
555
"""Configure a planetary variable subscription source."""
@@ -569,7 +561,10 @@ def test_pv_source_success(geom_geojson, var_type, var_id):
569
561
end_time = datetime (2021 , 3 , 2 ),
570
562
)
571
563
572
- assert source ["type" ] == var_type
564
+ if var_type :
565
+ assert source ["type" ] == var_type
566
+ else :
567
+ assert "type" not in source
573
568
params = source ["parameters" ]
574
569
assert params ["id" ] == var_id
575
570
assert params ["geometry" ] == geom_geojson
0 commit comments