Skip to content

Commit c61d81c

Browse files
committed
test/python_tests/shapefile_test.py: ds.all_features() --> iter(ds)
1 parent 0f0b048 commit c61d81c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/python_tests/shapefile_test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def test_dbf_logical_field_is_boolean():
5959
query = mapnik.Query(ds.envelope())
6060
for fld in ds.fields():
6161
query.add_property_name(fld)
62-
feat = list(ds.all_features())[0]
62+
feat = list(iter(ds))[0]
6363
assert feat.id() == 1
6464
assert feat['LONG'] == '0'
6565
assert feat['LAT'] == '0'
@@ -75,7 +75,7 @@ def test_shapefile_point2d_from_qgis():
7575
assert len(ds.fields()) == 2
7676
assert ds.fields(), ['id' == 'name']
7777
assert ds.field_types(), ['int' == 'str']
78-
assert len(list(ds.all_features())) == 3
78+
assert len(list(iter(ds))) == 3
7979

8080
# ogr2ogr tests/data/shp/3dpoint/ogr_zfield.shp
8181
# tests/data/shp/3dpoint/qgis.shp -zfield id
@@ -84,14 +84,14 @@ def test_shapefile_point_z_from_qgis():
8484
assert len(ds.fields()) == 2
8585
assert ds.fields(), ['id' == 'name']
8686
assert ds.field_types(), ['int' == 'str']
87-
assert len(list(ds.all_features())) == 3
87+
assert len(list(iter(ds))) == 3
8888

8989
def test_shapefile_multipoint_from_qgis():
9090
ds = mapnik.Shapefile(file='../data/shp/points/qgis_multi.shp')
9191
assert len(ds.fields()) == 2
9292
assert ds.fields(), ['id' == 'name']
9393
assert ds.field_types(), ['int' == 'str']
94-
assert len(list(ds.all_features())) == 1
94+
assert len(list(iter(ds))) == 1
9595

9696
# pointzm from arcinfo
9797
def test_shapefile_point_zm_from_arcgis():
@@ -105,7 +105,7 @@ def test_shapefile_point_zm_from_arcgis():
105105
'Name',
106106
'Website']
107107
assert ds.field_types() == ['str', 'str', 'str', 'float', 'float', 'str', 'str']
108-
assert len(list(ds.all_features())) == 17
108+
assert len(list(iter(ds))) == 17
109109

110110
# copy of the above with ogr2ogr that makes m record 14 instead of 18
111111
def test_shapefile_point_zm_from_ogr():
@@ -119,4 +119,4 @@ def test_shapefile_point_zm_from_ogr():
119119
'Name',
120120
'Website']
121121
assert ds.field_types() == ['str', 'str', 'str', 'float', 'float', 'str', 'str']
122-
assert len(list(ds.all_features())) == 17
122+
assert len(list(iter(ds))) == 17

0 commit comments

Comments
 (0)