def test_create_polygon_from_linestring(self): ls = LineString([(0, 0), (2, 0), (2, 2), (0, 2)]) p = Polygon(ls) self.assertEqual(p.length, 8)