示例#1
0
 def test_stack_opper_swap_subtract(self):
     stack = Stack()
     stack.append(5)
     stack.append(10)
     stack.swap()
     stack.math.subtract()
     assert len(stack) is 1 and stack[-1] is 5
示例#2
0
 def test_swap(self):
     stack = Stack('abc')
     stack.swap()
     assert stack[-1] is 'b' and stack[-2] is 'c'