Exemple #1
0
 def test_ArrayQueue_front(self):
     queue = ArrayQueue()
     for i in range(100):
         queue.enqueue(i + 1)
     for i in range(100):
         assert_equal(i + 1, queue.front())
         queue.dequeue()
Exemple #2
0
 def test_ArrayQueue_multipleoperations(self):
     queue = ArrayQueue()
     for i in range(100):
         queue.enqueue(i + 100)
     for i in range(50):
         queue.dequeue()
     for i in range(100):
         queue.enqueue(i + 200)
     assert_equal(150, queue.front())
Exemple #3
0
 def test_ArrayQueue_enqueue(self):
     queue = ArrayQueue()
     for i in range(100):
         queue.enqueue(i + 1)
         assert_equal(1, queue.front())
     assert_equal(100, len(queue))
Exemple #4
0
 def test_emptyArrayQueue_front(self):
     queue = ArrayQueue()
     val = queue.front()