Skip to content

Commit f3a41be

Browse files
committed
add tests for schemas
1 parent a890275 commit f3a41be

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

tests/test_features.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ class GenericProperties(BaseModel):
7171
}
7272

7373

74+
@pytest.mark.parametrize(
75+
"obj",
76+
[
77+
FeatureCollection,
78+
Feature,
79+
],
80+
)
81+
def test_pydantic_schema(obj):
82+
"""Test schema for Pydantic Object."""
83+
assert obj.model_json_schema()
84+
85+
7486
def test_feature_collection_iteration():
7587
"""test if feature collection is iterable"""
7688
gc = FeatureCollection(

tests/test_geometries.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,23 @@
1818
)
1919

2020

21+
@pytest.mark.parametrize(
22+
"obj",
23+
[
24+
GeometryCollection,
25+
LineString,
26+
MultiLineString,
27+
MultiPoint,
28+
MultiPolygon,
29+
Point,
30+
Polygon,
31+
],
32+
)
33+
def test_pydantic_schema(obj):
34+
"""Test schema for Pydantic Object."""
35+
assert obj.model_json_schema()
36+
37+
2138
def assert_wkt_equivalence(geom: Union[Geometry, GeometryCollection]):
2239
"""Assert WKT equivalence with Shapely."""
2340
# Remove any trailing `.0` to match Shapely format

0 commit comments

Comments
 (0)