MCPcopy
hub / github.com/django/django / test03b_layer_slice

Method test03b_layer_slice

tests/gis_tests/gdal_tests/test_ds.py:214–227  ·  view source on GitHub ↗

Test indexing and slicing on Layers.

(self)

Source from the content-addressed store, hash-verified

212 feat.__getitem__("invalid")
213
214 def test03b_layer_slice(self):
215 "Test indexing and slicing on Layers."
216 # Using the first data-source because the same slice
217 # can be used for both the layer and the control values.
218 source = ds_list[0]
219 ds = DataSource(source.ds)
220
221 sl = slice(1, 3)
222 feats = ds[0][sl]
223
224 for fld_name in ds[0].fields:
225 test_vals = [feat.get(fld_name) for feat in feats]
226 control_vals = source.field_values[fld_name][sl]
227 self.assertEqual(control_vals, test_vals)
228
229 def test03c_layer_references(self):
230 """

Callers

nothing calls this directly

Calls 2

DataSourceClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected