Ejemplo n.º 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'])
Ejemplo n.º 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'])
Ejemplo n.º 3
0
def test_lookup():
    stack = Stack(['foo', 'bar', 'fooz', 'baz'])
    assert_equal(list(stack.lookup()), ['foo', 'bar', 'fooz', 'baz'])
Ejemplo n.º 4
0
def test_lookup():
    stack = Stack(['foo', 'bar', 'fooz', 'baz'])
    assert_equal(list(stack.lookup()), ['foo', 'bar', 'fooz', 'baz'])