def test_historical_map():
    hist = ordered.HistoricalMap(maxlen=2)

    assert "foo" not in hist

    eq_(None, hist.insert('foo', "bar1"))

    assert "foo" in hist

    eq_(None, hist.insert('foo', "bar2"))

    eq_(('foo', "bar1"), hist.insert('not_foo', "not_bar"))
dataset/ETHPy150Open mediawiki-utilities/python-mediawiki-utilities/mw/util/tests/test_ordered.py/test_historical_map/original