From add8d7fd4eb2ad39bd4e70bc0f2566b3d5528f21 Mon Sep 17 00:00:00 2001 From: Simon Green Date: Sun, 18 Aug 2024 21:27:02 +1000 Subject: sgreen solutions to challenge 282 --- challenge-282/sgreen/python/test.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 challenge-282/sgreen/python/test.py (limited to 'challenge-282/sgreen/python/test.py') diff --git a/challenge-282/sgreen/python/test.py b/challenge-282/sgreen/python/test.py new file mode 100755 index 0000000000..d9a717e276 --- /dev/null +++ b/challenge-282/sgreen/python/test.py @@ -0,0 +1,21 @@ +#!/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.assertEqual(ch_1.good_integer(12344456), '444') + self.assertEqual(ch_1.good_integer(1233334), '-1') + self.assertEqual(ch_1.good_integer(10020003), '000') + + def test_ch_2(self): + self.assertEqual(ch_2.key_changes('pPeERrLl'), 3) + self.assertEqual(ch_2.key_changes('rRr'), 0) + self.assertEqual(ch_2.key_changes('GoO'), 1) + + +if __name__ == '__main__': + unittest.main() -- cgit