  
      def test13_attr_value(self):
          "Testing the attr_value() method."
          s1 = SpatialReference('WGS84')
          self.assertRaises(TypeError, s1.__getitem__, 0)
          self.assertRaises(TypeError, s1.__getitem__, ('GEOGCS', 'foo'))
          self.assertEqual('WGS 84', s1['GEOGCS'])
          self.assertEqual('WGS_1984', s1['DATUM'])
          self.assertEqual('EPSG', s1['AUTHORITY'])
          self.assertEqual(4326, int(s1['AUTHORITY', 1]))
          self.assertIsNone(s1['FOOBAR'])
 
</s> remove             self.assertRaises(TypeError, State.objects.reverse_geom)
 </s> add             with self.assertRaises(TypeError):
                State.objects.reverse_geom() </s> remove         self.assertRaises(TypeError, GEOSGeometry, None)
 </s> add         with self.assertRaises(TypeError):
            GEOSGeometry(None) </s> remove         self.assertRaises(TypeError, cntry_g.country_code, 17)
        self.assertRaises(TypeError, cntry_g.country_name, GeoIP)
 </s> add         with self.assertRaises(TypeError):
            cntry_g.country_code(17)
        with self.assertRaises(TypeError):
            cntry_g.country_name(GeoIP) </s> remove         self.assertRaises(TypeError, GEOSGeometry, NotAGeometry())
 </s> add         with self.assertRaises(TypeError):
            GEOSGeometry(NotAGeometry()) </s> remove             self.assertRaises(e, GeoIP, bad, 0)
 </s> add             with self.assertRaises(e):
                GeoIP(bad, 0)
        with self.assertRaises(TypeError):
            s1.__getitem__(0)
        with self.assertRaises(TypeError):
            s1.__getitem__(('GEOGCS', 'foo'))
  
      def test13_attr_value(self):
          "Testing the attr_value() method."
          s1 = SpatialReference('WGS84')
        with self.assertRaises(TypeError):
            s1.__getitem__(0)
        with self.assertRaises(TypeError):
            s1.__getitem__(('GEOGCS', 'foo'))
        with self.assertRaises(TypeError):
            s1.__getitem__(0)
        with self.assertRaises(TypeError):
            s1.__getitem__(('GEOGCS', 'foo'))
          self.assertEqual('WGS 84', s1['GEOGCS'])
          self.assertEqual('WGS_1984', s1['DATUM'])
          self.assertEqual('EPSG', s1['AUTHORITY'])
          self.assertEqual(4326, int(s1['AUTHORITY', 1]))
          self.assertIsNone(s1['FOOBAR'])
keep keep keep keep replace replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/gis_tests/gdal_tests/test_srs.py