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

Method test_switch_pairs

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

Source from the content-addressed store, hash-verified

49 )
50
51 def test_switch_pairs(self):
52 # Test case: even number of values in stack
53 # bottom [3, 8, 17, 9, 1, 10] top
54 self.assertEqual([8, 3, 9, 17, 10, 1], first_switch_pairs([3, 8, 17, 9, 1, 10]))
55 self.assertEqual(
56 [8, 3, 9, 17, 10, 1], second_switch_pairs([3, 8, 17, 9, 1, 10])
57 )
58 # Test case: odd number of values in stack
59 # bottom [3, 8, 17, 9, 1] top
60 self.assertEqual([8, 3, 9, 17, 1], first_switch_pairs([3, 8, 17, 9, 1]))
61 self.assertEqual([8, 3, 9, 17, 1], second_switch_pairs([3, 8, 17, 9, 1]))
62
63 def test_is_valid_parenthesis(self):
64

Callers

nothing calls this directly

Calls 2

first_switch_pairsFunction · 0.90
second_switch_pairsFunction · 0.90

Tested by

no test coverage detected