'Testing OGRGeomType object.'

def test00a_geomtype(self):

    try:
        g = OGRGeomType(1)
        g = OGRGeomType(7)
        g = OGRGeomType('point')
        g = OGRGeomType('GeometrycollectioN')
        g = OGRGeomType('LINearrING')
        g = OGRGeomType('Unknown')
    except:
        self.fail('Could    not    create    an    OGRGeomType    object!')
    self.assertRaises(OGRException, OGRGeomType, 23)
    self.assertRaises(OGRException, OGRGeomType, 'fooD')
    self.assertRaises(OGRException, OGRGeomType, 9)
    self.assertEqual(True, (OGRGeomType(1) == OGRGeomType(1)))
    self.assertEqual(True, (OGRGeomType(7) == 'GeometryCollection'))
    self.assertEqual(True, (OGRGeomType('point') == 'POINT'))
    self.assertEqual(False, (OGRGeomType('point') == 2))
    self.assertEqual(True, (OGRGeomType('unknown') == 0))
    self.assertEqual(True, (OGRGeomType(6) == 'MULtiPolyGON'))
    self.assertEqual(False, (OGRGeomType(1) != OGRGeomType('point')))
    self.assertEqual(True, (OGRGeomType('POINT') != OGRGeomType(6)))
    self.assertEqual('PointField', OGRGeomType('Point').django)
    self.assertEqual('GeometryField', OGRGeomType('Unknown').django)
    self.assertEqual(None, OGRGeomType('none').django)
    gt = OGRGeomType('Geometry')
    self.assertEqual(0, gt.num)
    self.assertEqual('Unknown', gt.name)
