@@ -73,14 +73,18 @@ class GenericProperties(BaseModel):
73
73
74
74
def test_feature_collection_iteration ():
75
75
"""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
+ )
77
79
assert hasattr (gc , "__geo_interface__" )
78
80
iter (gc )
79
81
80
82
81
83
def test_geometry_collection_iteration ():
82
84
"""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
+ )
84
88
assert hasattr (gc , "__geo_interface__" )
85
89
iter (gc )
86
90
@@ -96,7 +100,9 @@ def test_generic_properties_is_dict():
96
100
def test_generic_properties_is_dict_collection ():
97
101
feature = Feature (** test_feature_geometry_collection )
98
102
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
+ )
100
106
assert type (feature .properties ) == dict
101
107
assert not hasattr (feature .properties , "id" )
102
108
@@ -126,7 +132,9 @@ def test_generic_geometry():
126
132
127
133
128
134
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
+ )
130
138
assert feature .properties .id == test_feature_geometry_collection ["properties" ]["id" ]
131
139
assert type (feature .geometry ) == GeometryCollection
132
140
assert feature .geometry .wkt .startswith ("GEOMETRYCOLLECTION (POLYGON " )
@@ -135,7 +143,9 @@ def test_generic_geometry_collection():
135
143
136
144
feature = Feature [GeometryCollection , Dict ](** test_feature_geometry_collection )
137
145
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
+ )
139
149
assert type (feature .properties ) == dict
140
150
assert not hasattr (feature .properties , "id" )
141
151
@@ -145,7 +155,9 @@ def test_generic_geometry_collection():
145
155
146
156
def test_generic_properties_should_raise_for_string ():
147
157
with pytest .raises (ValidationError ):
148
- Feature (** ({"type" : "Feature" , "geometry" : polygon , "properties" : "should raise" }))
158
+ Feature (
159
+ ** ({"type" : "Feature" , "geometry" : polygon , "properties" : "should raise" })
160
+ )
149
161
150
162
151
163
def test_feature_collection_generic ():
@@ -219,8 +231,12 @@ def test_feature_validation():
219
231
# missing geometry
220
232
Feature (type = "Feature" , properties = None )
221
233
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
+ )
224
240
225
241
with pytest .raises (ValidationError ):
226
242
# bad bbox2d
0 commit comments