Example #1
0
def test_Queue_enqueue_multiple_items():
    my_queue = Queue()
    my_queue.enqueue(1)
    my_queue.enqueue(2)
    my_queue.enqueue(3)
    actual = my_queue.peek()
    expected = 1
    assert actual == expected
Example #2
0
def test_Queue_peek_front():
    my_queue = Queue()
    my_queue.enqueue(1)
    my_queue.enqueue(2)
    my_queue.enqueue(3)
    actual = my_queue.peek()
    expected = 1
    assert actual == expected
Example #3
0
def test_Queue_peek_empty_Exception():
    with pytest.raises(AttributeError):
        my_queue = Queue()
        actual = my_queue.peek()
        expected = "Can't peek front from an empty queue"
        assert actual == expected
Example #4
0
def test_Queue_enqueue_one_item():
    my_queue = Queue()
    my_queue.enqueue(1)
    actual = my_queue.peek()
    expected = 1
    assert actual == expected