'Testing LayerMapping initialization.'

def test01_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):
        try:
            lm = LayerMapping(City, city_shp, bad_map)
        except LayerMapError:
            pass
        else:
            self.fail('Expected    a    LayerMapError.')
    try:
        lm = LayerMapping(City, city_shp, city_mapping, encoding='foobar')
    except LookupError:
        pass
    else:
        self.fail('Expected    a    LookupError')
