def testSchemaAsContainer(self):
    s = feature.Schema('test', [('att1', str), ('att2', int), ('geom', geom.Point, 'epsg:3005')])
    assert s['att1']
    assert (s['att1'].typ == str)
    expected = [f.name for f in s.fields]
    assert ([name for name in s] == expected)
    expected = [f for f in s.fields]
    assert ([f for (name, f) in s.iteritems()] == expected)
    try:
        s['foo']
        assert False
    except KeyError:
        pass
    assert (s.values() == s.fields)
    assert (s.keys() == [f.name for f in s.fields])
def testSchemaAsContainer(self):
    s = feature.Schema('test', [('att1', str), ('att2', int), ('geom', geom.Point, 'epsg:3005')])
    assert s['att1']
    assert (s['att1'].typ == str)
    expected = [f.name for f in s.fields]
    assert ([name for name in s] == expected)
    expected = [f for f in s.fields]
    assert ([f for (name, f) in s.iteritems()] == expected)
    try:
        s['foo']
        assert False
    except KeyError:
        pass
    assert (s.values() == s.fields)
    assert (s.keys() == [f.name for f in s.fields])