def test_odict(self):
        o = util.OrderedDict()
        o['a'] = 1
        o['b'] = 2
        o['snack'] = 'attack'
        o['c'] = 3

        eq_(list(o.keys()), ['a', 'b', 'snack', 'c'])
        eq_(list(o.values()), [1, 2, 'attack', 3])

        o.pop('snack')
        eq_(list(o.keys()), ['a', 'b', 'c'])
        eq_(list(o.values()), [1, 2, 3])

        try:
            o.pop('eep')
            assert False
        except __HOLE__:
            pass

        eq_(o.pop('eep', 'woot'), 'woot')

        try:
            o.pop('whiff', 'bang', 'pow')
            assert False
        except TypeError:
            pass

        eq_(list(o.keys()), ['a', 'b', 'c'])
        eq_(list(o.values()), [1, 2, 3])

        o2 = util.OrderedDict(d=4)
        o2['e'] = 5

        eq_(list(o2.keys()), ['d', 'e'])
        eq_(list(o2.values()), [4, 5])

        o.update(o2)
        eq_(list(o.keys()), ['a', 'b', 'c', 'd', 'e'])
        eq_(list(o.values()), [1, 2, 3, 4, 5])

        o.setdefault('c', 'zzz')
        o.setdefault('f', 6)
        eq_(list(o.keys()), ['a', 'b', 'c', 'd', 'e', 'f'])
        eq_(list(o.values()), [1, 2, 3, 4, 5, 6])
dataset/ETHPy150Open zzzeek/sqlalchemy/test/base/test_utils.py/OrderedDictTest.test_odict