def test_insert_two_then_remove(self):
     queue = ArrayPriorityQueue()
     queue.insert(1)
     queue.insert(2)
     res = queue.remove()
     self.assertEqual(res, 2)
     self.assertEqual(queue.list(), [1])
 def test_insert_one(self):
     queue = ArrayPriorityQueue()
     queue.insert(1)
     self.assertEqual(queue.list(), [1])
 def test_insert_until_full(self):
     queue = ArrayPriorityQueue(5)
     for i in range(5):
         queue.insert(i)
     self.assertEqual(queue.list(), [0, 1, 2, 3, 4])
 def test_insert_random_to_sorted(self):
     queue = ArrayPriorityQueue()
     for i in range(3):
         queue.insert(i)
     queue.insert(1)
     self.assertEqual(queue.list(), [0, 1, 1, 2])
 def test_insert_two(self):
     queue = ArrayPriorityQueue()
     queue.insert(1)
     queue.insert(2)
     self.assertEqual(queue.list(), [1, 2])