1 from nose.tools import eq_
7 circle = ordered.Circle(3)
11 eq_(None, circle.append(5))
14 eq_(None, circle.append(6))
17 eq_(None, circle.append(7))
20 eq_(5, circle.append(8))
24 eq_([6, 7, 8], list(circle))
27 eq_([8, 7, 6], list(reversed(circle)))
30 def test_historical_map():
31 hist = ordered.HistoricalMap(maxlen=2)
33 assert "foo" not in hist
35 eq_(None, hist.insert('foo', "bar1"))
39 eq_(None, hist.insert('foo', "bar2"))
41 eq_(('foo', "bar1"), hist.insert('not_foo', "not_bar"))