Skip to content

Commit 66499f9

Browse files
Peter Van Bouwelsoxofaan
authored andcommitted
test: adapt unittest to assert new warnings of c59fe34
This is for the broken unittests in #788
1 parent c59fe34 commit 66499f9

File tree

2 files changed

+38
-10
lines changed

2 files changed

+38
-10
lines changed

tests/rest/test_connection.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3137,12 +3137,21 @@ def test_load_stac_band_filtering_no_band_metadata_default(self, dummy_backend,
31373137
@pytest.mark.parametrize(
31383138
["bands", "has_band_dimension", "expected_pg_args", "expected_warnings"],
31393139
[
3140-
(None, False, {}, ["bands_from_stac_collection: no band name source found"]),
3140+
(
3141+
None,
3142+
False,
3143+
{},
3144+
[
3145+
"bands_from_stac_collection: consulting items for band metadata",
3146+
"bands_from_stac_collection: no band name source found",
3147+
],
3148+
),
31413149
(
31423150
["B02", "B03"],
31433151
True,
31443152
{"bands": ["B02", "B03"]},
31453153
[
3154+
"bands_from_stac_collection: consulting items for band metadata",
31463155
"bands_from_stac_collection: no band name source found",
31473156
"Bands ['B02', 'B03'] were specified in `load_stac`, but no band dimension was detected in the STAC metadata. Working with band dimension and specified bands.",
31483157
],

tests/test_metadata.py

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,9 @@ def test_band_from_common_bands_metadata(self):
12231223
Band("B04", common_name="red", wavelength_um=0.665),
12241224
Band("B03", common_name="green", wavelength_um=0.560),
12251225
],
1226-
[],
1226+
[
1227+
"bands_from_stac_catalog with summaries.keys()=dict_keys(['eo:bands']) (which is non-standard)",
1228+
],
12271229
),
12281230
(
12291231
{
@@ -1243,7 +1245,10 @@ def test_band_from_common_bands_metadata(self):
12431245
Band("B04", common_name="red", wavelength_um=0.665),
12441246
Band("B03", common_name="green", wavelength_um=0.560),
12451247
],
1246-
["Using 'eo:bands' metadata, but STAC extension eo was not declared."],
1248+
[
1249+
"bands_from_stac_catalog with summaries.keys()=dict_keys(['eo:bands']) (which is non-standard)",
1250+
"Using 'eo:bands' metadata, but STAC extension eo was not declared.",
1251+
],
12471252
),
12481253
(
12491254
{
@@ -1260,7 +1265,9 @@ def test_band_from_common_bands_metadata(self):
12601265
"links": [],
12611266
},
12621267
[Band("B04"), Band("B03")],
1263-
[],
1268+
[
1269+
"bands_from_stac_catalog with summaries.keys()=dict_keys(['bands']) (which is non-standard)",
1270+
],
12641271
),
12651272
(
12661273
{
@@ -1280,7 +1287,9 @@ def test_band_from_common_bands_metadata(self):
12801287
Band("B04", common_name="red", wavelength_um=0.665),
12811288
Band("B03", common_name="green", wavelength_um=0.560),
12821289
],
1283-
[],
1290+
[
1291+
"bands_from_stac_catalog with summaries.keys()=dict_keys(['bands']) (which is non-standard)",
1292+
],
12841293
),
12851294
],
12861295
)
@@ -1384,7 +1393,9 @@ def test_bands_from_stac_collection(self, data, expected, caplog, expected_warni
13841393
},
13851394
{},
13861395
[Band("B02"), Band("B03")],
1387-
[],
1396+
[
1397+
"bands_from_stac_collection: consulting items for band metadata",
1398+
],
13881399
),
13891400
(
13901401
# Collection with two items with different bands (eo:bands metadata)
@@ -1413,7 +1424,9 @@ def test_bands_from_stac_collection(self, data, expected, caplog, expected_warni
14131424
},
14141425
{},
14151426
[Band("B02"), Band("B03")],
1416-
[],
1427+
[
1428+
"bands_from_stac_collection: consulting items for band metadata",
1429+
],
14171430
),
14181431
(
14191432
# Collection with two items with different bands in different metadata format
@@ -1441,7 +1454,9 @@ def test_bands_from_stac_collection(self, data, expected, caplog, expected_warni
14411454
},
14421455
{},
14431456
[Band("B02"), Band("B03")],
1444-
[],
1457+
[
1458+
"bands_from_stac_collection: consulting items for band metadata",
1459+
],
14451460
),
14461461
(
14471462
# Collection with one item, with band metadata in asset
@@ -1466,7 +1481,9 @@ def test_bands_from_stac_collection(self, data, expected, caplog, expected_warni
14661481
},
14671482
{},
14681483
[Band("B02")],
1469-
[],
1484+
[
1485+
"bands_from_stac_collection: consulting items for band metadata",
1486+
],
14701487
),
14711488
(
14721489
# Collection with multiple items and assets, only partially with band metadata
@@ -1497,7 +1514,9 @@ def test_bands_from_stac_collection(self, data, expected, caplog, expected_warni
14971514
},
14981515
{},
14991516
[Band("B02")],
1500-
[],
1517+
[
1518+
"bands_from_stac_collection: consulting items for band metadata",
1519+
],
15011520
),
15021521
],
15031522
)

0 commit comments

Comments
 (0)