def test_clear(): pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)] shuffle(pairs) od = OrderedDict(pairs) assert len(od) == len(pairs) od.clear() assert len(od) == 0
def test_od_clear(): od = OrderedDict([('a', 'b'), ('c', 'd'), ('foo', 'bar')]) od.clear() assert od == {}
def test_od_clear(): od = OrderedDict([("a", "b"), ("c", "d"), ("foo", "bar")]) od.clear() assert od == {}