diff options
| author | Mohammad Sajid Anwar <Mohammad.Anwar@yahoo.com> | 2025-08-31 13:16:08 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-31 13:16:08 +0100 |
| commit | 3d90f94bdeac5ce01337b308e98207418b410329 (patch) | |
| tree | ea868dcb1ce3d36e34071b1168e56d34ada9d437 /challenge-336/sgreen/python/test.py | |
| parent | 439fc065638af844b9a3117acbf9ea68bfb08000 (diff) | |
| parent | aae335bccca20a06aa5a45e5cafd50cca347cff3 (diff) | |
| download | perlweeklychallenge-club-3d90f94bdeac5ce01337b308e98207418b410329.tar.gz perlweeklychallenge-club-3d90f94bdeac5ce01337b308e98207418b410329.tar.bz2 perlweeklychallenge-club-3d90f94bdeac5ce01337b308e98207418b410329.zip | |
Merge pull request #12600 from simongreen-net/master
sgreen solutions to challenge 336
Diffstat (limited to 'challenge-336/sgreen/python/test.py')
| -rwxr-xr-x | challenge-336/sgreen/python/test.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/challenge-336/sgreen/python/test.py b/challenge-336/sgreen/python/test.py new file mode 100755 index 0000000000..4255288078 --- /dev/null +++ b/challenge-336/sgreen/python/test.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +import unittest +ch_1 = __import__('ch-1') +ch_2 = __import__('ch-2') + + +class TestClass(unittest.TestCase): + def test_ch_1(self): + self.assertTrue(ch_1.equal_group([1,1,2,2,2,2])) + self.assertFalse(ch_1.equal_group([1,1,1,2,2,2,3,3])) + self.assertTrue(ch_1.equal_group([5,5,5,5,5,5,7,7,7,7,7,7])) + self.assertFalse(ch_1.equal_group([1,2,3,4])) + self.assertTrue(ch_1.equal_group([8,8,9,9,10,10,11,11])) + + def test_ch_2(self): + self.assertEqual(ch_2.final_score(["5","2","C","D","+"]), 30) + self.assertEqual(ch_2.final_score(["5","-2","4","C","D","9","+","+"]), 27) + self.assertEqual(ch_2.final_score(["7","D","D","C","+","3"]), 45) + self.assertEqual(ch_2.final_score(["-5","-10","+","D","C","+"]), -55) + self.assertEqual(ch_2.final_score(["3","6","+","D","C","8","+","D","-2","C","+"]), 128) + + +if __name__ == '__main__': + unittest.main() |
