From 26b535649767b67efbcb64256c38407472dfd037 Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Tue, 17 Jun 2025 18:51:38 +0800 Subject: [PATCH 1/2] add v110 item collection tests --- tests/test_validate_item_collection.py | 225 +++++++++++++++++++++++++ 1 file changed, 225 insertions(+) diff --git a/tests/test_validate_item_collection.py b/tests/test_validate_item_collection.py index c74db64a..66213125 100644 --- a/tests/test_validate_item_collection.py +++ b/tests/test_validate_item_collection.py @@ -661,3 +661,228 @@ def test_validate_item_collection_remote_pages(): "validation_method": "default", }, ] + + +def test_validate_item_collection_remote_pages_v110(): + stac_file = "https://stac.dataspace.copernicus.eu/v1/collections/sentinel-3-olci-2-wfr-nrt/items" + stac = stac_validator.StacValidate(stac_file, item_collection=True, pages=1) + stac.validate_item_collection() + assert stac.message == [ + { + "asset_type": "ITEM", + "path": "https://stac.dataspace.copernicus.eu/v1/collections/sentinel-3-olci-2-wfr-nrt/items", + "schema": [ + "https://cs-si.github.io/eopf-stac-extension/v1.2.0/schema.json", + "https://stac-extensions.github.io/alternate-assets/v1.2.0/schema.json", + "https://stac-extensions.github.io/authentication/v1.1.0/schema.json", + "https://stac-extensions.github.io/eo/v2.0.0/schema.json", + "https://stac-extensions.github.io/file/v2.1.0/schema.json", + "https://stac-extensions.github.io/processing/v1.2.0/schema.json", + "https://stac-extensions.github.io/product/v0.1.0/schema.json", + "https://stac-extensions.github.io/projection/v2.0.0/schema.json", + "https://stac-extensions.github.io/sat/v1.1.0/schema.json", + "https://stac-extensions.github.io/storage/v2.0.0/schema.json", + "https://stac-extensions.github.io/timestamps/v1.1.0/schema.json", + "https://schemas.stacspec.org/v1.1.0/item-spec/json-schema/item.json", + ], + "valid_stac": True, + "validation_method": "default", + "version": "1.1.0", + }, + { + "asset_type": "ITEM", + "path": "https://stac.dataspace.copernicus.eu/v1/collections/sentinel-3-olci-2-wfr-nrt/items", + "schema": [ + "https://cs-si.github.io/eopf-stac-extension/v1.2.0/schema.json", + "https://stac-extensions.github.io/alternate-assets/v1.2.0/schema.json", + "https://stac-extensions.github.io/authentication/v1.1.0/schema.json", + "https://stac-extensions.github.io/eo/v2.0.0/schema.json", + "https://stac-extensions.github.io/file/v2.1.0/schema.json", + "https://stac-extensions.github.io/processing/v1.2.0/schema.json", + "https://stac-extensions.github.io/product/v0.1.0/schema.json", + "https://stac-extensions.github.io/projection/v2.0.0/schema.json", + "https://stac-extensions.github.io/sat/v1.1.0/schema.json", + "https://stac-extensions.github.io/storage/v2.0.0/schema.json", + "https://stac-extensions.github.io/timestamps/v1.1.0/schema.json", + "https://schemas.stacspec.org/v1.1.0/item-spec/json-schema/item.json", + ], + "valid_stac": True, + "validation_method": "default", + "version": "1.1.0", + }, + { + "asset_type": "ITEM", + "path": "https://stac.dataspace.copernicus.eu/v1/collections/sentinel-3-olci-2-wfr-nrt/items", + "schema": [ + "https://cs-si.github.io/eopf-stac-extension/v1.2.0/schema.json", + "https://stac-extensions.github.io/alternate-assets/v1.2.0/schema.json", + "https://stac-extensions.github.io/authentication/v1.1.0/schema.json", + "https://stac-extensions.github.io/eo/v2.0.0/schema.json", + "https://stac-extensions.github.io/file/v2.1.0/schema.json", + "https://stac-extensions.github.io/processing/v1.2.0/schema.json", + "https://stac-extensions.github.io/product/v0.1.0/schema.json", + "https://stac-extensions.github.io/projection/v2.0.0/schema.json", + "https://stac-extensions.github.io/sat/v1.1.0/schema.json", + "https://stac-extensions.github.io/storage/v2.0.0/schema.json", + "https://stac-extensions.github.io/timestamps/v1.1.0/schema.json", + "https://schemas.stacspec.org/v1.1.0/item-spec/json-schema/item.json", + ], + "valid_stac": True, + "validation_method": "default", + "version": "1.1.0", + }, + { + "asset_type": "ITEM", + "path": "https://stac.dataspace.copernicus.eu/v1/collections/sentinel-3-olci-2-wfr-nrt/items", + "schema": [ + "https://cs-si.github.io/eopf-stac-extension/v1.2.0/schema.json", + "https://stac-extensions.github.io/alternate-assets/v1.2.0/schema.json", + "https://stac-extensions.github.io/authentication/v1.1.0/schema.json", + "https://stac-extensions.github.io/eo/v2.0.0/schema.json", + "https://stac-extensions.github.io/file/v2.1.0/schema.json", + "https://stac-extensions.github.io/processing/v1.2.0/schema.json", + "https://stac-extensions.github.io/product/v0.1.0/schema.json", + "https://stac-extensions.github.io/projection/v2.0.0/schema.json", + "https://stac-extensions.github.io/sat/v1.1.0/schema.json", + "https://stac-extensions.github.io/storage/v2.0.0/schema.json", + "https://stac-extensions.github.io/timestamps/v1.1.0/schema.json", + "https://schemas.stacspec.org/v1.1.0/item-spec/json-schema/item.json", + ], + "valid_stac": True, + "validation_method": "default", + "version": "1.1.0", + }, + { + "asset_type": "ITEM", + "path": "https://stac.dataspace.copernicus.eu/v1/collections/sentinel-3-olci-2-wfr-nrt/items", + "schema": [ + "https://cs-si.github.io/eopf-stac-extension/v1.2.0/schema.json", + "https://stac-extensions.github.io/alternate-assets/v1.2.0/schema.json", + "https://stac-extensions.github.io/authentication/v1.1.0/schema.json", + "https://stac-extensions.github.io/eo/v2.0.0/schema.json", + "https://stac-extensions.github.io/file/v2.1.0/schema.json", + "https://stac-extensions.github.io/processing/v1.2.0/schema.json", + "https://stac-extensions.github.io/product/v0.1.0/schema.json", + "https://stac-extensions.github.io/projection/v2.0.0/schema.json", + "https://stac-extensions.github.io/sat/v1.1.0/schema.json", + "https://stac-extensions.github.io/storage/v2.0.0/schema.json", + "https://stac-extensions.github.io/timestamps/v1.1.0/schema.json", + "https://schemas.stacspec.org/v1.1.0/item-spec/json-schema/item.json", + ], + "valid_stac": True, + "validation_method": "default", + "version": "1.1.0", + }, + { + "asset_type": "ITEM", + "path": "https://stac.dataspace.copernicus.eu/v1/collections/sentinel-3-olci-2-wfr-nrt/items", + "schema": [ + "https://cs-si.github.io/eopf-stac-extension/v1.2.0/schema.json", + "https://stac-extensions.github.io/alternate-assets/v1.2.0/schema.json", + "https://stac-extensions.github.io/authentication/v1.1.0/schema.json", + "https://stac-extensions.github.io/eo/v2.0.0/schema.json", + "https://stac-extensions.github.io/file/v2.1.0/schema.json", + "https://stac-extensions.github.io/processing/v1.2.0/schema.json", + "https://stac-extensions.github.io/product/v0.1.0/schema.json", + "https://stac-extensions.github.io/projection/v2.0.0/schema.json", + "https://stac-extensions.github.io/sat/v1.1.0/schema.json", + "https://stac-extensions.github.io/storage/v2.0.0/schema.json", + "https://stac-extensions.github.io/timestamps/v1.1.0/schema.json", + "https://schemas.stacspec.org/v1.1.0/item-spec/json-schema/item.json", + ], + "valid_stac": True, + "validation_method": "default", + "version": "1.1.0", + }, + { + "asset_type": "ITEM", + "path": "https://stac.dataspace.copernicus.eu/v1/collections/sentinel-3-olci-2-wfr-nrt/items", + "schema": [ + "https://cs-si.github.io/eopf-stac-extension/v1.2.0/schema.json", + "https://stac-extensions.github.io/alternate-assets/v1.2.0/schema.json", + "https://stac-extensions.github.io/authentication/v1.1.0/schema.json", + "https://stac-extensions.github.io/eo/v2.0.0/schema.json", + "https://stac-extensions.github.io/file/v2.1.0/schema.json", + "https://stac-extensions.github.io/processing/v1.2.0/schema.json", + "https://stac-extensions.github.io/product/v0.1.0/schema.json", + "https://stac-extensions.github.io/projection/v2.0.0/schema.json", + "https://stac-extensions.github.io/sat/v1.1.0/schema.json", + "https://stac-extensions.github.io/storage/v2.0.0/schema.json", + "https://stac-extensions.github.io/timestamps/v1.1.0/schema.json", + "https://schemas.stacspec.org/v1.1.0/item-spec/json-schema/item.json", + ], + "valid_stac": True, + "validation_method": "default", + "version": "1.1.0", + }, + { + "asset_type": "ITEM", + "path": "https://stac.dataspace.copernicus.eu/v1/collections/sentinel-3-olci-2-wfr-nrt/items", + "schema": [ + "https://cs-si.github.io/eopf-stac-extension/v1.2.0/schema.json", + "https://stac-extensions.github.io/alternate-assets/v1.2.0/schema.json", + "https://stac-extensions.github.io/authentication/v1.1.0/schema.json", + "https://stac-extensions.github.io/eo/v2.0.0/schema.json", + "https://stac-extensions.github.io/file/v2.1.0/schema.json", + "https://stac-extensions.github.io/processing/v1.2.0/schema.json", + "https://stac-extensions.github.io/product/v0.1.0/schema.json", + "https://stac-extensions.github.io/projection/v2.0.0/schema.json", + "https://stac-extensions.github.io/sat/v1.1.0/schema.json", + "https://stac-extensions.github.io/storage/v2.0.0/schema.json", + "https://stac-extensions.github.io/timestamps/v1.1.0/schema.json", + "https://schemas.stacspec.org/v1.1.0/item-spec/json-schema/item.json", + ], + "valid_stac": True, + "validation_method": "default", + "version": "1.1.0", + }, + { + "asset_type": "ITEM", + "path": "https://stac.dataspace.copernicus.eu/v1/collections/sentinel-3-olci-2-wfr-nrt/items", + "schema": [ + "https://cs-si.github.io/eopf-stac-extension/v1.2.0/schema.json", + "https://stac-extensions.github.io/alternate-assets/v1.2.0/schema.json", + "https://stac-extensions.github.io/authentication/v1.1.0/schema.json", + "https://stac-extensions.github.io/eo/v2.0.0/schema.json", + "https://stac-extensions.github.io/file/v2.1.0/schema.json", + "https://stac-extensions.github.io/processing/v1.2.0/schema.json", + "https://stac-extensions.github.io/product/v0.1.0/schema.json", + "https://stac-extensions.github.io/projection/v2.0.0/schema.json", + "https://stac-extensions.github.io/sat/v1.1.0/schema.json", + "https://stac-extensions.github.io/storage/v2.0.0/schema.json", + "https://stac-extensions.github.io/timestamps/v1.1.0/schema.json", + "https://schemas.stacspec.org/v1.1.0/item-spec/json-schema/item.json", + ], + "valid_stac": True, + "validation_method": "default", + "version": "1.1.0", + }, + { + "asset_type": "ITEM", + "path": "https://stac.dataspace.copernicus.eu/v1/collections/sentinel-3-olci-2-wfr-nrt/items", + "schema": [ + "https://cs-si.github.io/eopf-stac-extension/v1.2.0/schema.json", + "https://stac-extensions.github.io/alternate-assets/v1.2.0/schema.json", + "https://stac-extensions.github.io/authentication/v1.1.0/schema.json", + "https://stac-extensions.github.io/eo/v2.0.0/schema.json", + "https://stac-extensions.github.io/file/v2.1.0/schema.json", + "https://stac-extensions.github.io/processing/v1.2.0/schema.json", + "https://stac-extensions.github.io/product/v0.1.0/schema.json", + "https://stac-extensions.github.io/projection/v2.0.0/schema.json", + "https://stac-extensions.github.io/sat/v1.1.0/schema.json", + "https://stac-extensions.github.io/storage/v2.0.0/schema.json", + "https://stac-extensions.github.io/timestamps/v1.1.0/schema.json", + "https://schemas.stacspec.org/v1.1.0/item-spec/json-schema/item.json", + ], + "valid_stac": True, + "validation_method": "default", + "version": "1.1.0", + }, + ] + + +def test_validate_item_collection_remote_pages_3_v110(): + stac_file = "https://stac.dataspace.copernicus.eu/v1/collections/sentinel-3-olci-2-wfr-nrt/items" + stac = stac_validator.StacValidate(stac_file, item_collection=True, pages=3) + stac.validate_item_collection() + assert len(stac.message) == 30 From 7a21b64d805cd07b2a5ff25a1226cb8e0bf1202a Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Tue, 17 Jun 2025 18:54:28 +0800 Subject: [PATCH 2/2] assert length of 1 page test --- tests/test_validate_item_collection.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_validate_item_collection.py b/tests/test_validate_item_collection.py index 66213125..161cff43 100644 --- a/tests/test_validate_item_collection.py +++ b/tests/test_validate_item_collection.py @@ -663,7 +663,7 @@ def test_validate_item_collection_remote_pages(): ] -def test_validate_item_collection_remote_pages_v110(): +def test_validate_item_collection_remote_pages_1_v110(): stac_file = "https://stac.dataspace.copernicus.eu/v1/collections/sentinel-3-olci-2-wfr-nrt/items" stac = stac_validator.StacValidate(stac_file, item_collection=True, pages=1) stac.validate_item_collection() @@ -879,6 +879,7 @@ def test_validate_item_collection_remote_pages_v110(): "version": "1.1.0", }, ] + assert len(stac.message) == 10 def test_validate_item_collection_remote_pages_3_v110():