def test01d_errors(self):
        "Testing the Error handlers."
        # string-based
        print "\nBEGIN - expecting GEOS_ERROR; safe to ignore.\n"
        for err in self.geometries.errors:
            try:
                g = fromstr(err.wkt)
            except (GEOSException, __HOLE__):
                pass

        # Bad WKB
        self.assertRaises(GEOSException, GEOSGeometry, buffer('0'))

        print "\nEND - expecting GEOS_ERROR; safe to ignore.\n"

        class NotAGeometry(object):
            pass

        # Some other object
        self.assertRaises(TypeError, GEOSGeometry, NotAGeometry())
        # None
        self.assertRaises(TypeError, GEOSGeometry, None)
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/django/contrib/gis/geos/tests/test_geos.py/GEOSTest.test01d_errors