예제 #1
0
def test_peek(populated_pq, insert_item, result_pq):
    from priorityq import PriorityQueue
    pq = PriorityQueue()
    pq._container = result_pq
    assert pq.peek() == result_pq[0]
예제 #2
0
def test_pop(populated_pq, pop_values):
    from priorityq import PriorityQueue
    pq = PriorityQueue()
    pq._container = populated_pq
    for i in range(len(pq._container)):
        assert pq.pop() == pop_values[i]
예제 #3
0
def test_insert(populated_pq, insert_item, result_pq):
    from priorityq import PriorityQueue
    pq = PriorityQueue()
    pq._container = populated_pq
    pq.insert(insert_item)
    assert pq._container == result_pq
예제 #4
0
def test_peek(populated_pq, insert_item, result_pq):
    from priorityq import PriorityQueue
    pq = PriorityQueue()
    pq._container = result_pq
    assert pq.peek() == result_pq[0]
예제 #5
0
def test_pop(populated_pq, pop_values):
    from priorityq import PriorityQueue
    pq = PriorityQueue()
    pq._container = populated_pq
    for i in range(len(pq._container)):
        assert pq.pop() == pop_values[i]
예제 #6
0
def test_insert(populated_pq, insert_item, result_pq):
    from priorityq import PriorityQueue
    pq = PriorityQueue()
    pq._container = populated_pq
    pq.insert(insert_item)
    assert pq._container == result_pq