def __add_corner_cases(self): queue = PrioritizedQueue(ordering_policy) queue.add(0, 0.3) queue.add(1, 0.2) queue.add(3, 0.3) queue.add(4, 0.25) self.assertEqual(result, list(queue))
def __update_no_item(self): queue = PrioritizedQueue(ordering_policy) queue.add(0, 1) queue.add(1, 2) queue.add(3, 4) queue.update(2, 3) self.assertEqual(result, list(queue))
def __add_chess_order(self): queue = PrioritizedQueue(ordering_policy) queue.add(0, 3) queue.add(1, 2) queue.add(2, 4) queue.add(3, 3) queue.add(4, 5) queue.add(5, 1) self.assertEqual(result, list(queue))
def __update_increase(self): queue = PrioritizedQueue(ordering_policy) queue.add(0, 1) queue.add(1, 2) queue.add(2, 3) queue.add(3, 4) queue.add(4, 5) queue.update(3, 2) self.assertEqual(result1, list(queue)) queue.add(2.5, 3) self.assertEqual(result2, list(queue)) queue.update(3, 1) self.assertEqual(result3, list(queue))
def __add_asc_backward_order(self): queue = PrioritizedQueue(ordering_policy) queue.add(0, 3) queue.add(1, 2) queue.add(2, 1) self.assertEqual(result, list(queue))