MCPcopy
hub / github.com/django/django / test_normalize

Method test_normalize

tests/gis_tests/geos_tests/test_geos.py:1698–1709  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1696 self.assertEqual(GEOSGeometry("POINT(1.0e-1 1.0e+1)"), Point(0.1, 10))
1697
1698 def test_normalize(self):
1699 multipoint = MultiPoint(Point(0, 0), Point(2, 2), Point(1, 1))
1700 normalized = MultiPoint(Point(2, 2), Point(1, 1), Point(0, 0))
1701 # Geometry is normalized in-place and nothing is returned.
1702 multipoint_1 = multipoint.clone()
1703 self.assertIsNone(multipoint_1.normalize())
1704 self.assertEqual(multipoint_1, normalized)
1705 # If the `clone` keyword is set, then the geometry is not modified and
1706 # a normalized clone of the geometry is returned instead.
1707 multipoint_2 = multipoint.normalize(clone=True)
1708 self.assertEqual(multipoint_2, normalized)
1709 self.assertNotEqual(multipoint, normalized)
1710
1711 def test_make_valid(self):
1712 poly = GEOSGeometry("POLYGON((0 0, 0 23, 23 0, 23 23, 0 0))")

Callers

nothing calls this directly

Calls 4

MultiPointClass · 0.90
PointClass · 0.90
cloneMethod · 0.45
normalizeMethod · 0.45

Tested by

no test coverage detected