              if isinstance(bad, six.string_types):
                  e = GeoIPException
              else:
                  e = TypeError
              self.assertRaises(e, GeoIP, bad, 0)
  
      def test02_bad_query(self):
          "Testing GeoIP query parameter checking."
          cntry_g = GeoIP(city='<foo>')
          # No city database available, these calls should fail.
 
</s> remove             self.assertRaises(e, GeoIP2, bad, 0)
 </s> add             with self.assertRaises(e):
                GeoIP2(bad, 0) </s> remove         self.assertRaises(GeoIPException, cntry_g.city, 'google.com')
        self.assertRaises(GeoIPException, cntry_g.coords, 'yahoo.com')
 </s> add         with self.assertRaises(GeoIPException):
            cntry_g.city('google.com')
        with self.assertRaises(GeoIPException):
            cntry_g.coords('yahoo.com') </s> remove             self.assertRaises(GeoIPException, GeoIP, cache=bad)
 </s> add             with self.assertRaises(GeoIPException):
                GeoIP(cache=bad) </s> remove         self.assertRaises(GeoIP2Exception, cntry_g.city, 'tmc.edu')
        self.assertRaises(GeoIP2Exception, cntry_g.coords, 'tmc.edu')
 </s> add         with self.assertRaises(GeoIP2Exception):
            cntry_g.city('tmc.edu')
        with self.assertRaises(GeoIP2Exception):
            cntry_g.coords('tmc.edu') </s> remove             self.assertRaises(GeoIP2Exception, GeoIP2, cache=bad)
 </s> add             with self.assertRaises(GeoIP2Exception):
                GeoIP2(cache=bad)
            with self.assertRaises(e):
                GeoIP(bad, 0)
              if isinstance(bad, six.string_types):
                  e = GeoIPException
              else:
                  e = TypeError
            with self.assertRaises(e):
                GeoIP(bad, 0)
  
      def test02_bad_query(self):
          "Testing GeoIP query parameter checking."
          cntry_g = GeoIP(city='<foo>')
          # No city database available, these calls should fail.
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/gis_tests/test_geoip.py