Пример #1
0
 def test_top_of_empty(self, int_stack: PushStack):
     assert int_stack.top() == Token.no_stack_item
Пример #2
0
 def test_top(self, int_stack: PushStack):
     int_stack.push(5).push(-10)
     assert int_stack.top() == -10
Пример #3
0
 def test_top(self, int_stack: PushStack):
     int_stack.push(5).push(-10)
     assert int_stack.top() == -10
Пример #4
0
 def test_top_of_empty(self, int_stack: PushStack):
     assert int_stack.top() == Token.no_stack_item
Пример #5
0
 def test_init_values(self):
     stack = PushStack(PushStr, ["bottom", "middle", "top"])
     assert stack.top() == "top"
     assert list(stack) == ["bottom", "middle", "top"]