Exemple #1
0
def test_queue_node_next_type():
    mock = MyQueue()
    mock.queue(2)
    assert mock.first.next == None
Exemple #2
0
def test_queue_bad_input():
    mock = MyQueue()
    assert mock.queue(None) == "Can not enqueue None"
Exemple #3
0
def test_queue_node():
    mock = MyQueue()
    mock.queue(2)
    assert type(mock.first) == MyQueue._Node
Exemple #4
0
def test_queue_deque():
    mock_queue = MyQueue()
    mock_queue.queue(2)
    mock_queue.queue(3)
    assert mock_queue.dequeue() == 2
Exemple #5
0
def test_queue_next():
    mock = MyQueue()
    mock.queue(2)
    mock.queue(3)
    assert mock.first.next.key == 3
Exemple #6
0
def test_print_queue():
    mockResult = MyQueue()
    mockTest = [x for x in range(100)]
    for x in range(100):
        mockResult.queue(x)
    assert str(mockResult) == str(mockTest)
Exemple #7
0
def test_queue_queue():
    mock = MyQueue()
    mock.queue(2)
    assert mock.first.key == 2