MCPcopy
hub / github.com/django/django / test_multilinestring

Method test_multilinestring

tests/gis_tests/gdal_tests/test_geom.py:184–201  ·  view source on GitHub ↗

Testing MultiLineString objects.

(self)

Source from the content-addressed store, hash-verified

182 self.assertEqual(y, linestr.y)
183
184 def test_multilinestring(self):
185 "Testing MultiLineString objects."
186 prev = OGRGeometry("POINT(0 0)")
187 for mls in self.geometries.multilinestrings:
188 mlinestr = OGRGeometry(mls.wkt)
189 self.assertEqual(5, mlinestr.geom_type)
190 self.assertEqual("MULTILINESTRING", mlinestr.geom_name)
191 self.assertEqual(mls.n_p, mlinestr.point_count)
192 self.assertEqual(mls.coords, mlinestr.tuple)
193 self.assertEqual(mlinestr, OGRGeometry(mls.wkt))
194 self.assertNotEqual(mlinestr, prev)
195 prev = mlinestr
196 for ls in mlinestr:
197 self.assertEqual(2, ls.geom_type)
198 self.assertEqual("LINESTRING", ls.geom_name)
199 msg = "Index out of range when accessing geometry in a collection: %s."
200 with self.assertRaisesMessage(IndexError, msg % len(mlinestr)):
201 mlinestr.__getitem__(len(mlinestr))
202
203 def test_linearring(self):
204 "Testing LinearRing objects."

Callers

nothing calls this directly

Calls 3

OGRGeometryClass · 0.90
assertRaisesMessageMethod · 0.80
__getitem__Method · 0.45

Tested by

no test coverage detected