def testAsContainer(self):
    id = 'fid'
    g = geom.Point((- 125), 50)
    a = {'x': 1, 'y': 1.1, 'z': 'one', 'geom': g}
    f = feature.Feature(a, 'fid')
    assert (1 == f['x'])
    try:
        f['foo']
        assert False
    except KeyError:
        pass
    assert ([x for x in f.schema] == [y for y in f])
    expected = [(x, y) for (x, y) in f.attributes.iteritems()]
    assert ([(x, y) for (x, y) in f.iteritems()] == expected)
    assert (sorted(f.attributes.keys()) == sorted(f.keys()))
    assert (sorted(f.attributes.values()) == sorted(f.values()))
def testAsContainer(self):
    id = 'fid'
    g = geom.Point((- 125), 50)
    a = {'x': 1, 'y': 1.1, 'z': 'one', 'geom': g}
    f = feature.Feature(a, 'fid')
    assert (1 == f['x'])
    try:
        f['foo']
        assert False
    except KeyError:
        pass
    assert ([x for x in f.schema] == [y for y in f])
    expected = [(x, y) for (x, y) in f.attributes.iteritems()]
    assert ([(x, y) for (x, y) in f.iteritems()] == expected)
    assert (sorted(f.attributes.keys()) == sorted(f.keys()))
    assert (sorted(f.attributes.values()) == sorted(f.values()))