Skip to content

Commit e7eb186

Browse files
committed
Add test coverage for schema summary types
1 parent 4556302 commit e7eb186

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tests/test_collection.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from pystac.extensions.eo import EOExtension
1010
from pystac.validation import validate_dict
1111
from pystac import Collection, Item, Extent, SpatialExtent, TemporalExtent, CatalogType
12-
from pystac.utils import datetime_to_str
12+
from pystac.utils import datetime_to_str, get_required
1313
from tests.utils import TestCases, ARBITRARY_GEOM, ARBITRARY_BBOX
1414

1515
TEST_DATETIME = datetime(2020, 3, 14, 16, 32)
@@ -182,6 +182,20 @@ def test_assets(self) -> None:
182182
collection = pystac.Collection.from_dict(data)
183183
collection.validate()
184184

185+
def test_schema_summary(self) -> None:
186+
collection = pystac.Collection.from_file(
187+
TestCases.get_path(
188+
"data-files/examples/1.0.0/collection-only/collection-with-schemas.json"
189+
)
190+
)
191+
instruments_schema = get_required(
192+
collection.summaries.get_schema("instruments"),
193+
collection.summaries,
194+
"instruments",
195+
)
196+
197+
self.assertIsInstance(instruments_schema, dict)
198+
185199

186200
class ExtentTest(unittest.TestCase):
187201
def test_spatial_allows_single_bbox(self) -> None:

0 commit comments

Comments
 (0)