Beispiel #1
0
 def test_select_simple():
     d = OrderedTreeDict([(0, 0), (1, 1), (2, 2)])
     assert len(d) == 3
     assert (d.select(0) == (0, 0))
     assert (d.select(1) == (1, 1))
     assert (d.select(2) == (2, 2))
Beispiel #2
0
 def test_select():
     """A test to check that select finds the nth item in sorted order."""
     keys = list(range(100))
     d = OrderedTreeDict((key, None) for key in keys)
     assert all(d.select(k)[0] == k for k in keys)