@@ -184,6 +184,13 @@ def test_list_layers_bytes(geojson_bytes):
184
184
assert layers [0 , 0 ] == "test"
185
185
186
186
187
+ def test_list_layers_nonseekable_bytes (nonseekable_bytes ):
188
+ layers = list_layers (nonseekable_bytes )
189
+
190
+ assert layers .shape == (1 , 2 )
191
+ assert layers [0 , 1 ] == "Point"
192
+
193
+
187
194
def test_list_layers_filelike (geojson_filelike ):
188
195
layers = list_layers (geojson_filelike )
189
196
@@ -218,6 +225,13 @@ def test_read_bounds_bytes(geojson_bytes):
218
225
assert allclose (bounds [:, 0 ], [- 180.0 , - 18.28799 , 180.0 , - 16.02088 ])
219
226
220
227
228
+ def test_read_bounds_nonseekable_bytes (nonseekable_bytes ):
229
+ fids , bounds = read_bounds (nonseekable_bytes )
230
+ assert fids .shape == (1 ,)
231
+ assert bounds .shape == (4 , 1 )
232
+ assert allclose (bounds [:, 0 ], [1 , 1 , 1 , 1 ])
233
+
234
+
221
235
def test_read_bounds_filelike (geojson_filelike ):
222
236
fids , bounds = read_bounds (geojson_filelike )
223
237
assert fids .shape == (3 ,)
@@ -449,6 +463,13 @@ def test_read_info_bytes(geojson_bytes):
449
463
assert meta ["features" ] == 3
450
464
451
465
466
+ def test_read_info_nonseekable_bytes (nonseekable_bytes ):
467
+ meta = read_info (nonseekable_bytes )
468
+
469
+ assert meta ["fields" ].shape == (0 ,)
470
+ assert meta ["features" ] == 1
471
+
472
+
452
473
def test_read_info_filelike (geojson_filelike ):
453
474
meta = read_info (geojson_filelike )
454
475
0 commit comments