Skip to content

Commit 8a1eddd

Browse files
author
Arthur Dujardin
committed
Update line break formatting with black
1 parent 13975d6 commit 8a1eddd

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

tests/test_features.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,18 @@ class GenericProperties(BaseModel):
7373

7474
def test_feature_collection_iteration():
7575
"""test if feature collection is iterable"""
76-
gc = FeatureCollection(type="FeatureCollection", features=[test_feature, test_feature])
76+
gc = FeatureCollection(
77+
type="FeatureCollection", features=[test_feature, test_feature]
78+
)
7779
assert hasattr(gc, "__geo_interface__")
7880
iter(gc)
7981

8082

8183
def test_geometry_collection_iteration():
8284
"""test if feature collection is iterable"""
83-
gc = FeatureCollection(type="FeatureCollection", features=[test_feature_geometry_collection])
85+
gc = FeatureCollection(
86+
type="FeatureCollection", features=[test_feature_geometry_collection]
87+
)
8488
assert hasattr(gc, "__geo_interface__")
8589
iter(gc)
8690

@@ -96,7 +100,9 @@ def test_generic_properties_is_dict():
96100
def test_generic_properties_is_dict_collection():
97101
feature = Feature(**test_feature_geometry_collection)
98102
assert hasattr(feature, "__geo_interface__")
99-
assert feature.properties["id"] == test_feature_geometry_collection["properties"]["id"]
103+
assert (
104+
feature.properties["id"] == test_feature_geometry_collection["properties"]["id"]
105+
)
100106
assert type(feature.properties) == dict
101107
assert not hasattr(feature.properties, "id")
102108

@@ -126,7 +132,9 @@ def test_generic_geometry():
126132

127133

128134
def test_generic_geometry_collection():
129-
feature = Feature[GeometryCollection, GenericProperties](**test_feature_geometry_collection)
135+
feature = Feature[GeometryCollection, GenericProperties](
136+
**test_feature_geometry_collection
137+
)
130138
assert feature.properties.id == test_feature_geometry_collection["properties"]["id"]
131139
assert type(feature.geometry) == GeometryCollection
132140
assert feature.geometry.wkt.startswith("GEOMETRYCOLLECTION (POLYGON ")
@@ -135,7 +143,9 @@ def test_generic_geometry_collection():
135143

136144
feature = Feature[GeometryCollection, Dict](**test_feature_geometry_collection)
137145
assert type(feature.geometry) == GeometryCollection
138-
assert feature.properties["id"] == test_feature_geometry_collection["properties"]["id"]
146+
assert (
147+
feature.properties["id"] == test_feature_geometry_collection["properties"]["id"]
148+
)
139149
assert type(feature.properties) == dict
140150
assert not hasattr(feature.properties, "id")
141151

@@ -145,7 +155,9 @@ def test_generic_geometry_collection():
145155

146156
def test_generic_properties_should_raise_for_string():
147157
with pytest.raises(ValidationError):
148-
Feature(**({"type": "Feature", "geometry": polygon, "properties": "should raise"}))
158+
Feature(
159+
**({"type": "Feature", "geometry": polygon, "properties": "should raise"})
160+
)
149161

150162

151163
def test_feature_collection_generic():
@@ -219,8 +231,12 @@ def test_feature_validation():
219231
# missing geometry
220232
Feature(type="Feature", properties=None)
221233

222-
assert Feature(type="Feature", properties=None, bbox=(0, 0, 100, 100), geometry=None)
223-
assert Feature(type="Feature", properties=None, bbox=(0, 0, 0, 100, 100, 100), geometry=None)
234+
assert Feature(
235+
type="Feature", properties=None, bbox=(0, 0, 100, 100), geometry=None
236+
)
237+
assert Feature(
238+
type="Feature", properties=None, bbox=(0, 0, 0, 100, 100, 100), geometry=None
239+
)
224240

225241
with pytest.raises(ValidationError):
226242
# bad bbox2d

0 commit comments

Comments
 (0)