Skip to content

Commit 8c52f31

Browse files
committed
add more tests
1 parent 5f98bdb commit 8c52f31

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/test_features.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,18 @@ def test_feature_collection_geo_interface_with_null_geometry():
188188
assert "bbox" not in fc.__geo_interface__
189189
assert "bbox" not in fc.__geo_interface__["features"][0]
190190
assert "bbox" in fc.__geo_interface__["features"][1]
191+
192+
193+
def test_feature_validation():
194+
"""Test default."""
195+
with pytest.raises(ValidationError):
196+
# should be type=Feature
197+
Feature(type="feature", properties={}, geometry=None)
198+
199+
with pytest.raises(ValidationError):
200+
# should be properties={}
201+
Feature(type="Feature", properties=None, geometry=None)
202+
203+
with pytest.raises(ValidationError):
204+
# should be geometry=None
205+
Feature(type="Feature", properties={})

0 commit comments

Comments
 (0)