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