예제 #1
0
def test_push():
    stack = Stack()
    stack.push('foo')
    stack.push('baar')
    assert_equal(stack.current, 'baar')
    stack.push('baz')
    assert_equal(list(stack.lookup()), ['foo', 'baar', 'baz'])
예제 #2
0
def test_push():
    stack = Stack()
    stack.push('foo')
    stack.push('baar')
    assert_equal(stack.current, 'baar')
    stack.push('baz')
    assert_equal(list(stack.lookup()), ['foo', 'baar', 'baz'])
예제 #3
0
def test_lookup():
    stack = Stack(['foo', 'bar', 'fooz', 'baz'])
    assert_equal(list(stack.lookup()), ['foo', 'bar', 'fooz', 'baz'])
예제 #4
0
def test_lookup():
    stack = Stack(['foo', 'bar', 'fooz', 'baz'])
    assert_equal(list(stack.lookup()), ['foo', 'bar', 'fooz', 'baz'])