Example #1
0
def test_one_push_two_node():
    stack = Stack()
    stack.push('a')
    stack.push('b')
    expected = 'b'
    actual = stack.top.value
    assert actual == expected
Example #2
0
def test_stack_pop_multiple():
    stack = Stack()
    stack.push(1)
    stack.push(2)
    stack.push(3)
    assert stack.pop() == 3
    assert stack.pop() == 2
    assert stack.pop() == 1
Example #3
0
def test_stack_push():
    stack = Stack()
    stack.push(1)
    assert stack.top.data== 1
Example #4
0
def test_stack_peek():
    stack = Stack()
    stack.push(1)
    stack.push(2)
    assert stack.peek() == 2
Example #5
0
def test_stack_push_multiple():
    stack = Stack()
    stack.push(1)
    stack.push(2)
    stack.push(3)
    assert stack.top.data == 3
Example #6
0
def test_one_push_one_node():
    stack = Stack()
    expected = 'a'
    stack.push('a')
    actual = stack.top.value
    assert actual == expected