Ejemplo n.º 1
0
def test_stack():
    S = ArrayStack()
    S.push(5)
    print(S.top())
    S.push(6)
    print(len(S))
    print(S.pop())
    print(S.is_empty())
    print(S.data)
 def test_arraystack_topthrowsempty(self):
     stack = ArrayStack()
     stack.top()
 def test_arraystack_push(self):
     stack = ArrayStack()
     for i in range(100):
         stack.push(i + 1)
         assert_equal(stack.top(), i + 1)