File tree 1 file changed +12
-5
lines changed
1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -983,8 +983,9 @@ def test_iterRecords_start_stop():
983
983
with shapefile .Reader ("shapefiles/blockgroups" ) as sf :
984
984
N = len (sf )
985
985
986
- # Arbitrary selection of start values
987
- for start in [
986
+ # Arbitrary selection of record indices
987
+ # (there are 663 records in blockgroups.dbf).
988
+ for i in [
988
989
0 ,
989
990
1 ,
990
991
2 ,
@@ -1003,11 +1004,17 @@ def test_iterRecords_start_stop():
1003
1004
N - 2 ,
1004
1005
N - 1 ,
1005
1006
]:
1006
- for stop in range (start , len (sf )):
1007
+ for record in sf .iterRecords (start = i ):
1008
+ assert record == sf .record (record .oid )
1009
+
1010
+ for record in sf .iterRecords (stop = i ):
1011
+ assert record == sf .record (record .oid )
1012
+
1013
+ for stop in range (i , len (sf )):
1007
1014
# test negative indexing from end, as well as
1008
1015
# positive values of stop, and its default
1009
- for stop_arg in (stop , stop - len (sf ), None ):
1010
- for record in sf .iterRecords (start = start , stop = stop ):
1016
+ for stop_arg in (stop , stop - len (sf )):
1017
+ for record in sf .iterRecords (start = i , stop = stop_arg ):
1011
1018
assert record == sf .record (record .oid )
1012
1019
1013
1020
You can’t perform that action at this time.
0 commit comments