Example #1
0
 def test_queue(self):
     my_q = Queue.Queue()
     my_q.enqueue(1)
     my_q.enqueue(2)
     my_q.enqueue(3)
     my_q.enqueue(4)
     test_array = []
     for i in range(4):
         test_array += [my_q.dequeue()]
     self.assertEqual(test_array, [1, 2, 3, 4])
     self.assertTrue(my_q.is_empty())
 def test_queue(self):
     my_q = Queue.Queue()
     my_q.add(1)
     my_q.add(2)
     my_q.add(3)
     my_q.add(4)
     test_array = []
     for i in range(4):
         test_array += [my_q.remove().value]
     self.assertEqual(test_array, [1, 2, 3, 4])
     self.assertTrue(my_q.is_empty())