From 9ec1032647bf14b55e4f4f6ddfdea532a3b0fe8e Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Sat, 26 Nov 2022 14:15:03 +0300 Subject: [PATCH 01/12] allow dictionary --- stac_check/lint.py | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/stac_check/lint.py b/stac_check/lint.py index cd273e5..99418fe 100644 --- a/stac_check/lint.py +++ b/stac_check/lint.py @@ -38,7 +38,7 @@ def __post_init__(self): self.invalid_link_request = self.check_links_assets(10, "links", "request") if self.links else None self.schema = self.message["schema"] if "schema" in self.message else [] self.object_id = self.data["id"] if "id" in self.data else "" - self.file_name = os.path.basename(self.item).split('.')[0] + self.file_name = self.get_asset_name(self.item) self.best_practices_msg = self.create_best_practices_msg() @staticmethod @@ -57,24 +57,41 @@ def parse_config(config_file): return default_config + def get_asset_name(self, file): + if isinstance(file, str): + return os.path.basename(file).split('.')[0] + else: + return file["id"] + def load_data(self, file): - if is_valid_url(file): - resp = requests.get(file) - data = resp.json() + if isinstance(file, str): + if is_valid_url(file): + resp = requests.get(file) + data = resp.json() + else: + with open(file) as json_file: + data = json.load(json_file) + return data else: - with open(file) as json_file: - data = json.load(json_file) - return data + return file def validate_file(self, file): - stac = StacValidate(file, links=self.links, assets=self.assets) - stac.run() + if isinstance(file, str): + stac = StacValidate(file, links=self.links, assets=self.assets) + stac.run() + else: + stac = StacValidate() + stac.validate_dict(file) return stac.message[0] def recursive_validation(self, file): if self.recursive: - stac = StacValidate(file, recursive=True, max_depth=self.max_depth) - stac.run() + if isinstance(file, str): + stac = StacValidate(file, recursive=True, max_depth=self.max_depth) + stac.run() + else: + stac = StacValidate(recursive=True, max_depth=self.max_depth) + stac.validate_dict(file) return stac.message def set_update_message(self): From 87533692f934c7ac0df4b449fff6d556900be977 Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Sat, 26 Nov 2022 14:25:00 +0300 Subject: [PATCH 02/12] update readme --- README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a5f7d5d..9dd5784 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,18 @@ $ make build $ make shell ``` --- -### Examples +### Validate Dictionary + +``` +from stac_linter.lint import Linter + +linter = Linter(dict) + +for k,v in linter.create_best_practices_dict().items(): + print(k,":",v) +``` +--- +### CLI Examples ``` stac-check https://raw.githubusercontent.com/stac-utils/pystac/main/tests/data-files/examples/0.9.0/collection-spec/examples/landsat-collection.json --recursive ``` ``` @@ -208,4 +219,4 @@ Validation error message: 'id' is a required property of the root of the STAC object This object has 5 links - \ No newline at end of file + From 5fecf283e021c1429a97fb3de28b3899d151c3a8 Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Sat, 26 Nov 2022 14:26:18 +0300 Subject: [PATCH 03/12] make readme clearer --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9dd5784..37b7bd7 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ or for local development `$ pip install -e .` --- -### Usage +### CLI Usage ``` Usage: stac-check [OPTIONS] FILE @@ -34,7 +34,7 @@ $ make build $ make shell ``` --- -### Validate Dictionary +### Lint Dictionary ``` from stac_linter.lint import Linter From 151a67cb2266349b024c9a63c8088428b7f2fcb4 Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Sat, 26 Nov 2022 14:41:51 +0300 Subject: [PATCH 04/12] create dict tests --- tests/test_lint.py | 241 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 241 insertions(+) diff --git a/tests/test_lint.py b/tests/test_lint.py index 7b23ea6..11cb77a 100644 --- a/tests/test_lint.py +++ b/tests/test_lint.py @@ -287,3 +287,244 @@ def test_catalog_name(): file = "sample_files/1.0.0/collection.json" linter = Linter(file) assert linter.check_catalog_id_file_name() + +def test_lint_dict_collection(): + file = { + "id": "simple-collection", + "type": "Collection", + "stac_extensions": [ + "https://stac-extensions.github.io/eo/v1.0.0/schema.json", + "https://stac-extensions.github.io/projection/v1.0.0/schema.json", + "https://stac-extensions.github.io/view/v1.0.0/schema.json" + ], + "stac_version": "1.0.0", + "description": "A simple collection demonstrating core catalog fields with links to a couple of items", + "title": "Simple Example Collection", + "providers": [ + { + "name": "Remote Data, Inc", + "description": "Producers of awesome spatiotemporal assets", + "roles": [ + "producer", + "processor" + ], + "url": "http://remotedata.io" + } + ], + "extent": { + "spatial": { + "bbox": [ + [ + 172.91173669923782, + 1.3438851951615003, + 172.95469614953714, + 1.3690476620161975 + ] + ] + }, + "temporal": { + "interval": [ + [ + "2020-12-11T22:38:32.125Z", + "2020-12-14T18:02:31.437Z" + ] + ] + } + }, + "license": "CC-BY-4.0", + "summaries": { + "platform": [ + "cool_sat1", + "cool_sat2" + ], + "constellation": [ + "ion" + ], + "instruments": [ + "cool_sensor_v1", + "cool_sensor_v2" + ], + "gsd": { + "minimum": 0.512, + "maximum": 0.66 + }, + "eo:cloud_cover": { + "minimum": 1.2, + "maximum": 1.2 + }, + "proj:epsg": { + "minimum": 32659, + "maximum": 32659 + }, + "view:sun_elevation": { + "minimum": 54.9, + "maximum": 54.9 + }, + "view:off_nadir": { + "minimum": 3.8, + "maximum": 3.8 + }, + "view:sun_azimuth": { + "minimum": 135.7, + "maximum": 135.7 + } + }, + "links": [ + { + "rel": "root", + "href": "./collection.json", + "type": "application/json", + "title": "Simple Example Collection" + }, + { + "rel": "item", + "href": "./simple-item.json", + "type": "application/geo+json", + "title": "Simple Item" + }, + { + "rel": "item", + "href": "./core-item.json", + "type": "application/geo+json" + }, + { + "rel": "item", + "href": "./extended-item.json", + "type": "application/geo+json", + "title": "Extended Item" + } + ] + } + linter = Linter(file) + assert linter.valid_stac == True + assert linter.create_best_practices_dict()["check_catalog_id"] == ["Object should be called 'collection.json' not 'simple-collection.json'"] + +def test_lint_dict_item(): + file = { + "stac_version": "1.0.0", + "stac_extensions": [], + "type": "Feature", + "id": "20201211_223832_CS2", + "bbox": [ + 172.91173669923782, + 1.3438851951615003, + 172.95469614953714, + 1.3690476620161975 + ], + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 172.91173669923782, + 1.3438851951615003 + ], + [ + 172.95469614953714, + 1.3438851951615003 + ], + [ + 172.95469614953714, + 1.3690476620161975 + ], + [ + 172.91173669923782, + 1.3690476620161975 + ], + [ + 172.91173669923782, + 1.3438851951615003 + ] + ] + ] + }, + "properties": { + "title": "Core Item", + "description": "A sample STAC Item that includes examples of all common metadata", + "datetime": None, + "start_datetime": "2020-12-11T22:38:32.125Z", + "end_datetime": "2020-12-11T22:38:32.327Z", + "created": "2020-12-12T01:48:13.725Z", + "updated": "2020-12-12T01:48:13.725Z", + "platform": "cool_sat1", + "instruments": [ + "cool_sensor_v1" + ], + "constellation": "ion", + "mission": "collection 5624", + "gsd": 0.512 + }, + "collection": "simple-collection", + "links": [ + { + "rel": "collection", + "href": "./collection.json", + "type": "application/json", + "title": "Simple Example Collection" + }, + { + "rel": "root", + "href": "./collection.json", + "type": "application/json", + "title": "Simple Example Collection" + }, + { + "rel": "parent", + "href": "./collection.json", + "type": "application/json", + "title": "Simple Example Collection" + }, + { + "rel": "alternate", + "type": "text/html", + "href": "http://remotedata.io/catalog/20201211_223832_CS2/index.html", + "title": "HTML version of this STAC Item" + } + ], + "assets": { + "analytic": { + "href": "https://storage.googleapis.com/open-cogs/stac-examples/20201211_223832_CS2_analytic.tif", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "title": "4-Band Analytic", + "roles": [ + "data" + ] + }, + "thumbnail": { + "href": "https://storage.googleapis.com/open-cogs/stac-examples/20201211_223832_CS2.jpg", + "title": "Thumbnail", + "type": "image/png", + "roles": [ + "thumbnail" + ] + }, + "visual": { + "href": "https://storage.googleapis.com/open-cogs/stac-examples/20201211_223832_CS2.tif", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "title": "3-Band Visual", + "roles": [ + "visual" + ] + }, + "udm": { + "href": "https://storage.googleapis.com/open-cogs/stac-examples/20201211_223832_CS2_analytic_udm.tif", + "title": "Unusable Data Mask", + "type": "image/tiff; application=geotiff;" + }, + "json-metadata": { + "href": "http://remotedata.io/catalog/20201211_223832_CS2/extended-metadata.json", + "title": "Extended Metadata", + "type": "application/json", + "roles": [ + "metadata" + ] + }, + "ephemeris": { + "href": "http://cool-sat.com/catalog/20201211_223832_CS2/20201211_223832_CS2.EPH", + "title": "Satellite Ephemeris Metadata" + } + } + } + linter = Linter(file) + assert linter.valid_stac == True + assert linter.create_best_practices_dict()["datetime_null"] == ['Please avoid setting the datetime field to null, many clients search on this field'] From 5926acf3a6ce0a76bbb6631a16aaae96d99eb6d2 Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Sat, 26 Nov 2022 15:01:19 +0300 Subject: [PATCH 05/12] add asset type check to tests --- tests/test_lint.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_lint.py b/tests/test_lint.py index 11cb77a..355a08b 100644 --- a/tests/test_lint.py +++ b/tests/test_lint.py @@ -397,6 +397,7 @@ def test_lint_dict_collection(): } linter = Linter(file) assert linter.valid_stac == True + assert linter.asset_type == "COLLECTION" assert linter.create_best_practices_dict()["check_catalog_id"] == ["Object should be called 'collection.json' not 'simple-collection.json'"] def test_lint_dict_item(): @@ -527,4 +528,5 @@ def test_lint_dict_item(): } linter = Linter(file) assert linter.valid_stac == True + assert linter.asset_type == "ITEM" assert linter.create_best_practices_dict()["datetime_null"] == ['Please avoid setting the datetime field to null, many clients search on this field'] From c5e276c8615218b8164a7775425421b96f6badcc Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Sat, 26 Nov 2022 15:01:59 +0300 Subject: [PATCH 06/12] use Union --- stac_check/lint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stac_check/lint.py b/stac_check/lint.py index 99418fe..b3123ef 100644 --- a/stac_check/lint.py +++ b/stac_check/lint.py @@ -6,7 +6,7 @@ import os from dataclasses import dataclass import requests -from typing import Optional +from typing import Optional, Union from dotenv import load_dotenv import pkg_resources @@ -14,7 +14,7 @@ @dataclass class Linter: - item: str + item: Union[str, dict] # url, file name, or dictionary config_file: Optional[str] = None assets: bool = False links: bool = False From 3dc0b97f5eb1d0698de9cce539f4ccf6f1689a46 Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Sat, 26 Nov 2022 16:02:41 +0300 Subject: [PATCH 07/12] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index af38811..bc8c3db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file. The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## Unreleased +## Added +- Ability to lint dictionaries https://github.com/stac-utils/stac-check/pull/94 ## [v1.3.1] - 2022-10-05 ## Changed From 31179c64a63beb6635e4e3941495f40c1f6eb3d6 Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Sat, 26 Nov 2022 16:10:45 +0300 Subject: [PATCH 08/12] add checks --- tests/test_lint.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_lint.py b/tests/test_lint.py index 355a08b..f36fb56 100644 --- a/tests/test_lint.py +++ b/tests/test_lint.py @@ -398,6 +398,7 @@ def test_lint_dict_collection(): linter = Linter(file) assert linter.valid_stac == True assert linter.asset_type == "COLLECTION" + assert linter.check_catalog_id_file_name() == False assert linter.create_best_practices_dict()["check_catalog_id"] == ["Object should be called 'collection.json' not 'simple-collection.json'"] def test_lint_dict_item(): @@ -529,4 +530,5 @@ def test_lint_dict_item(): linter = Linter(file) assert linter.valid_stac == True assert linter.asset_type == "ITEM" + assert linter.check_datetime_null() == True assert linter.create_best_practices_dict()["datetime_null"] == ['Please avoid setting the datetime field to null, many clients search on this field'] From 113c27f67272285dada7bb98ce7140b68d777e38 Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Tue, 29 Nov 2022 10:57:54 +0300 Subject: [PATCH 09/12] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc8c3db..ecdb3f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/) ## Unreleased ## Added - Ability to lint dictionaries https://github.com/stac-utils/stac-check/pull/94 +## Fixed +- Fixed the check_catalog_id_file_name() method to only work on static catalogs https://github.com/stac-utils/stac-check/pull/94 ## [v1.3.1] - 2022-10-05 ## Changed From e106c366a75c95b52e95b166e766ca7eea3cee68 Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Tue, 29 Nov 2022 10:58:48 +0300 Subject: [PATCH 10/12] check only static collections --- stac_check/lint.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/stac_check/lint.py b/stac_check/lint.py index b3123ef..7927030 100644 --- a/stac_check/lint.py +++ b/stac_check/lint.py @@ -197,10 +197,12 @@ def check_item_id_file_name(self): return True def check_catalog_id_file_name(self): - if self.asset_type == "CATALOG" and self.file_name != 'catalog': - return False - elif self.asset_type == "COLLECTION" and self.file_name != 'collection': - return False + if isinstance(self.item, str) and ".json" in self.item: + if self.asset_type == "CATALOG" and 'catalog.json' not in self.item: + return False + elif self.asset_type == "COLLECTION" and 'collection.json' not in self.item: + return False + return True else: return True @@ -228,7 +230,7 @@ def create_best_practices_dict(self): best_practices_dict["check_item_id"] = [msg_1] # best practices - collection and catalog file names should be collection.json and catalog.json - if not self.check_catalog_id_file_name() and config["catalog_id_file_name"] == True: + if self.check_catalog_id_file_name() == False and config["catalog_id_file_name"] == True: msg_1 = f"Object should be called '{self.asset_type.lower()}.json' not '{self.file_name}.json'" best_practices_dict["check_catalog_id"] = [msg_1] From 98bb03d028fae2d59900124180dd2aca5ab2ef59 Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Tue, 29 Nov 2022 10:59:03 +0300 Subject: [PATCH 11/12] fix test --- tests/test_lint.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_lint.py b/tests/test_lint.py index f36fb56..1ff0fe5 100644 --- a/tests/test_lint.py +++ b/tests/test_lint.py @@ -398,8 +398,7 @@ def test_lint_dict_collection(): linter = Linter(file) assert linter.valid_stac == True assert linter.asset_type == "COLLECTION" - assert linter.check_catalog_id_file_name() == False - assert linter.create_best_practices_dict()["check_catalog_id"] == ["Object should be called 'collection.json' not 'simple-collection.json'"] + assert linter.check_catalog_id_file_name() == True def test_lint_dict_item(): file = { From 8ebdc01d35fe6827a5e6f4ad182b65a46a4e35b1 Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Tue, 29 Nov 2022 11:02:22 +0300 Subject: [PATCH 12/12] change method name --- CHANGELOG.md | 2 +- stac_check/lint.py | 4 +- test_dict.py | 141 +++++++++++++++++++++++++++++++++++++++++++++ tests/test_lint.py | 10 ++-- 4 files changed, 149 insertions(+), 8 deletions(-) create mode 100644 test_dict.py diff --git a/CHANGELOG.md b/CHANGELOG.md index ecdb3f3..e7f7442 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/) ## Added - Ability to lint dictionaries https://github.com/stac-utils/stac-check/pull/94 ## Fixed -- Fixed the check_catalog_id_file_name() method to only work on static catalogs https://github.com/stac-utils/stac-check/pull/94 +- Fixed the check_catalog_file_name() method to only work on static catalogs https://github.com/stac-utils/stac-check/pull/94 ## [v1.3.1] - 2022-10-05 ## Changed diff --git a/stac_check/lint.py b/stac_check/lint.py index 7927030..43917fd 100644 --- a/stac_check/lint.py +++ b/stac_check/lint.py @@ -196,7 +196,7 @@ def check_item_id_file_name(self): else: return True - def check_catalog_id_file_name(self): + def check_catalog_file_name(self): if isinstance(self.item, str) and ".json" in self.item: if self.asset_type == "CATALOG" and 'catalog.json' not in self.item: return False @@ -230,7 +230,7 @@ def create_best_practices_dict(self): best_practices_dict["check_item_id"] = [msg_1] # best practices - collection and catalog file names should be collection.json and catalog.json - if self.check_catalog_id_file_name() == False and config["catalog_id_file_name"] == True: + if self.check_catalog_file_name() == False and config["catalog_id_file_name"] == True: msg_1 = f"Object should be called '{self.asset_type.lower()}.json' not '{self.file_name}.json'" best_practices_dict["check_catalog_id"] = [msg_1] diff --git a/test_dict.py b/test_dict.py new file mode 100644 index 0000000..900a855 --- /dev/null +++ b/test_dict.py @@ -0,0 +1,141 @@ +# from stac_check.lint import Linter + +# file = { +# "stac_version": "1.0.0", +# "stac_extensions": [], +# "type": "Feature", +# "id": "20201211_223832_CS2", +# "bbox": [ +# 172.91173669923782, +# 1.3438851951615003, +# 172.95469614953714, +# 1.3690476620161975 +# ], +# "geometry": { +# "type": "Polygon", +# "coordinates": [ +# [ +# [ +# 172.91173669923782, +# 1.3438851951615003 +# ], +# [ +# 172.95469614953714, +# 1.3438851951615003 +# ], +# [ +# 172.95469614953714, +# 1.3690476620161975 +# ], +# [ +# 172.91173669923782, +# 1.3690476620161975 +# ], +# [ +# 172.91173669923782, +# 1.3438851951615003 +# ] +# ] +# ] +# }, +# "properties": { +# "title": "Core Item", +# "description": "A sample STAC Item that includes examples of all common metadata", +# "datetime": None, +# "start_datetime": "2020-12-11T22:38:32.125Z", +# "end_datetime": "2020-12-11T22:38:32.327Z", +# "created": "2020-12-12T01:48:13.725Z", +# "updated": "2020-12-12T01:48:13.725Z", +# "platform": "cool_sat1", +# "instruments": [ +# "cool_sensor_v1" +# ], +# "constellation": "ion", +# "mission": "collection 5624", +# "gsd": 0.512 +# }, +# "collection": "simple-collection", +# "links": [ +# { +# "rel": "collection", +# "href": "./collection.json", +# "type": "application/json", +# "title": "Simple Example Collection" +# }, +# { +# "rel": "root", +# "href": "./collection.json", +# "type": "application/json", +# "title": "Simple Example Collection" +# }, +# { +# "rel": "parent", +# "href": "./collection.json", +# "type": "application/json", +# "title": "Simple Example Collection" +# }, +# { +# "rel": "alternate", +# "type": "text/html", +# "href": "http://remotedata.io/catalog/20201211_223832_CS2/index.html", +# "title": "HTML version of this STAC Item" +# } +# ], +# "assets": { +# "analytic": { +# "href": "https://storage.googleapis.com/open-cogs/stac-examples/20201211_223832_CS2_analytic.tif", +# "type": "image/tiff; application=geotiff; profile=cloud-optimized", +# "title": "4-Band Analytic", +# "roles": [ +# "data" +# ] +# }, +# "thumbnail": { +# "href": "https://storage.googleapis.com/open-cogs/stac-examples/20201211_223832_CS2.jpg", +# "title": "Thumbnail", +# "type": "image/png", +# "roles": [ +# "thumbnail" +# ] +# }, +# "visual": { +# "href": "https://storage.googleapis.com/open-cogs/stac-examples/20201211_223832_CS2.tif", +# "type": "image/tiff; application=geotiff; profile=cloud-optimized", +# "title": "3-Band Visual", +# "roles": [ +# "visual" +# ] +# }, +# "udm": { +# "href": "https://storage.googleapis.com/open-cogs/stac-examples/20201211_223832_CS2_analytic_udm.tif", +# "title": "Unusable Data Mask", +# "type": "image/tiff; application=geotiff;" +# }, +# "json-metadata": { +# "href": "http://remotedata.io/catalog/20201211_223832_CS2/extended-metadata.json", +# "title": "Extended Metadata", +# "type": "application/json", +# "roles": [ +# "metadata" +# ] +# }, +# "ephemeris": { +# "href": "http://cool-sat.com/catalog/20201211_223832_CS2/20201211_223832_CS2.EPH", +# "title": "Satellite Ephemeris Metadata" +# } +# } +# } +# linter = Linter(file, assets=True) + +# print(linter.valid_stac) + +# print(linter.error_type) + +# print(linter.error_msg) + +# for k,v in linter.create_best_practices_dict().items(): +# print(k,":",v) + +# print(linter.schema) + +# print(linter.file_name) \ No newline at end of file diff --git a/tests/test_lint.py b/tests/test_lint.py index 1ff0fe5..a9c1607 100644 --- a/tests/test_lint.py +++ b/tests/test_lint.py @@ -229,7 +229,7 @@ def test_linter_item_id_not_matching_file_name(): def test_linter_collection_catalog_id(): file = "sample_files/1.0.0/collection-no-title.json" linter = Linter(file) - assert linter.check_catalog_id_file_name() == False + assert linter.check_catalog_file_name() == False def test_linter_item_id_format_best_practices(): file = "sample_files/1.0.0/core-item-invalid-id.json" @@ -283,11 +283,11 @@ def test_self_in_links(): def test_catalog_name(): file = "sample_files/1.0.0/catalog.json" linter = Linter(file) - assert linter.check_catalog_id_file_name() + assert linter.check_catalog_file_name() file = "sample_files/1.0.0/collection.json" linter = Linter(file) - assert linter.check_catalog_id_file_name() - + assert linter.check_catalog_file_name() + def test_lint_dict_collection(): file = { "id": "simple-collection", @@ -398,7 +398,7 @@ def test_lint_dict_collection(): linter = Linter(file) assert linter.valid_stac == True assert linter.asset_type == "COLLECTION" - assert linter.check_catalog_id_file_name() == True + assert linter.check_catalog_file_name() == True def test_lint_dict_item(): file = {