def test_peek_fail(): """Test peek function on empty queue.""" from priority import Priority new_p_q = Priority() with pytest.raises(IndexError): new_p_q.peek()
def test_peek(): """Test peek function on populated queue.""" from priority import Priority new_p_q = Priority([("monkey", 1), ("cat", 2), ("dog", 1)]) assert new_p_q.peek() == ("monkey")