'Testing LayerMapping initialization.'

def test_init(self):

    bad1 = copy(city_mapping)
    bad1['foobar'] = 'FooField'
    bad2 = copy(city_mapping)
    bad2['name'] = 'Nombre'
    bad3 = copy(city_mapping)
    bad3['point'] = 'CURVE'
    for bad_map in (bad1, bad2, bad3):
        with self.assertRaises(LayerMapError):
            LayerMapping(City, city_shp, bad_map)
    with self.assertRaises(LookupError):
        LayerMapping(City, city_shp, city_mapping, encoding='foobar')
