MCPcopy
hub / github.com/keon/algorithms / test_ordered_stack

Method test_ordered_stack

tests/test_stack.py:144–154  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

142
143class TestOrderedStack(unittest.TestCase):
144 def test_ordered_stack(self):
145 stack = OrderedStack()
146 self.assertTrue(stack.is_empty())
147 stack.push(1)
148 stack.push(4)
149 stack.push(3)
150 stack.push(6)
151 "bottom - > 1 3 4 6 "
152 self.assertEqual(6, stack.pop())
153 self.assertEqual(4, stack.peek())
154 self.assertEqual(3, stack.size())
155
156
157if __name__ == "__main__":

Callers

nothing calls this directly

Calls 6

is_emptyMethod · 0.95
pushMethod · 0.95
popMethod · 0.95
peekMethod · 0.95
sizeMethod · 0.95
OrderedStackClass · 0.90

Tested by

no test coverage detected