def test_enqueue_two(): q = Queue() q.enqueue("apples") q.enqueue("bananas") actual = q.peek() expected = "apples" assert actual == expected
def test_peek_post_dequeue(): q = Queue() q.enqueue("apples") q.enqueue("bananas") q.dequeue() actual = q.peek() expected = "bananas" assert actual == expected
def test_peek(): q = Queue() q.enqueue("apple") q.enqueue("banana") q.enqueue("cucumber") actual = q.peek() expected = "apple" assert actual == expected
def test_peek_when_empty(): q = Queue() with pytest.raises(InvalidOperationError): q.peek()