示例#1
0
def test_queue_node_next_type():
    mock = MyQueue()
    mock.queue(2)
    assert mock.first.next == None
示例#2
0
def test_queue_bad_input():
    mock = MyQueue()
    assert mock.queue(None) == "Can not enqueue None"
示例#3
0
def test_queue_node():
    mock = MyQueue()
    mock.queue(2)
    assert type(mock.first) == MyQueue._Node
示例#4
0
def test_queue_deque():
    mock_queue = MyQueue()
    mock_queue.queue(2)
    mock_queue.queue(3)
    assert mock_queue.dequeue() == 2
示例#5
0
def test_queue_next():
    mock = MyQueue()
    mock.queue(2)
    mock.queue(3)
    assert mock.first.next.key == 3
示例#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)
示例#7
0
def test_queue_queue():
    mock = MyQueue()
    mock.queue(2)
    assert mock.first.key == 2