Exemplo n.º 1
0
 def test_constructor_single_none(self):
     queue = CircularQueue([None])
     assert queue.entries == [None]
     assert queue.next() is None
     assert queue.next() is None
     assert queue.next() is None
     assert queue.next() is None
     assert queue.next() is None
     assert queue.next() is None
Exemplo n.º 2
0
 def test_constructor_single(self):
     queue = CircularQueue(["a"])
     assert queue.entries == ["a"]
     assert queue.next() == "a"
     assert queue.next() == "a"
     assert queue.next() == "a"
     assert queue.next() == "a"
     assert queue.next() == "a"
     assert queue.next() == "a"
Exemplo n.º 3
0
 def test_constructor_multiple_first_none(self):
     queue = CircularQueue(["a", "b", "c", "d", "e", None], first=None)
     assert queue.entries == ["a", "b", "c", "d", "e", None]
     assert queue.next() is None
     assert queue.next() == "a"
     assert queue.next() == "b"
     assert queue.next() == "c"
     assert queue.next() == "d"
     assert queue.next() == "e"
     assert queue.next() is None
     assert queue.next() == "a"
     assert queue.next() == "b"
     assert queue.next() == "c"
     assert queue.next() == "d"
     assert queue.next() == "e"
     assert queue.next() is None