|
| 1 | +#!/usr/bin/env python3 |
| 2 | +# author: greyshell |
| 3 | +# how to run: python -m unittest test_blance_bracket.TestSolution |
| 4 | + |
| 5 | +import unittest |
| 6 | +from blance_bracket import solution |
| 7 | + |
| 8 | + |
| 9 | +class TestSolution(unittest.TestCase): |
| 10 | + |
| 11 | + def test_solution_case_1(self): |
| 12 | + self.assertEqual(solution(['(', '(']), False) |
| 13 | + |
| 14 | + def test_solution_case_2(self): |
| 15 | + self.assertEqual(solution(['(', ')']), True) |
| 16 | + |
| 17 | + def test_solution_case_3(self): |
| 18 | + self.assertEqual(solution([')', '(']), False) |
| 19 | + |
| 20 | + def test_solution_case_4(self): |
| 21 | + self.assertEqual(solution(['(', '(', ')', ')']), True) |
| 22 | + |
| 23 | + def test_solution_case_5(self): |
| 24 | + self.assertEqual(solution([')', ')']), False) |
| 25 | + |
| 26 | + def test_solution_case_6(self): |
| 27 | + self.assertEqual(solution(['(', '(', ')', '(', ')']), False) |
| 28 | + |
| 29 | + def test_solution_case_7(self): |
| 30 | + self.assertEqual(solution(['(', ')', '(']), False) |
| 31 | + |
| 32 | + def test_solution_case_8(self): |
| 33 | + self.assertEqual(solution(['(', ')', ')']), False) |
| 34 | + |
| 35 | + def test_solution_case_9(self): |
| 36 | + self.assertEqual(solution(['(', '(', ')', '(', ')', ')']), True) |
| 37 | + |
| 38 | + |
| 39 | +if __name__ == '__main__': |
| 40 | + unittest.main() |
0 commit comments