Ticket #5630: gis_geos_empty.diff
File gis_geos_empty.diff, 1.5 KB (added by , 17 years ago) |
---|
-
django/contrib/gis/geos/pointer.py
186 186 n_child = len(ptr_list) 187 187 188 188 # Determining whether coordinate sequences pointers were passed in. 189 if isinstance(ptr_list[0], (tuple, list)):189 if n_child and isinstance(ptr_list[0], (tuple, list)): 190 190 self._child_cs = True 191 191 else: 192 192 self._child_cs = False -
django/contrib/gis/tests/test_geos.py
722 722 mpoly = MultiPolygon(poly.clone(), poly) 723 723 self.assertEqual(8.0, mpoly.length) 724 724 725 def test20_emptyCollections(self): 726 "Testing empty geometry collections" 727 g = GeometryCollection([]) 728 self.assert_(g.empty) 729 self.assertEqual(0, g.num_geom) 730 731 g = GEOSGeometry("GEOMETRYCOLLECTION EMPTY") 732 self.assert_(g.empty) 733 self.assert_(isinstance(g, GeometryCollection)) 734 self.assertEqual(0, g.num_geom) 735 725 736 def suite(): 726 737 s = unittest.TestSuite() 727 738 s.addTest(unittest.makeSuite(GEOSTest)) … … 729 740 730 741 def run(verbosity=2): 731 742 unittest.TextTestRunner(verbosity=verbosity).run(suite()) 743 744 if __name__=="__main__": 745 unittest.main()