aboutsummaryrefslogtreecommitdiff
path: root/challenge-258/sgreen/python/test.py
diff options
context:
space:
mode:
authorMohammad S Anwar <mohammad.anwar@yahoo.com>2024-03-04 00:07:21 +0000
committerMohammad S Anwar <mohammad.anwar@yahoo.com>2024-03-04 00:07:21 +0000
commit40d47c8ead708860c4e3f21bae091506a42807f4 (patch)
treef3afcf3e43492360076f7462c4466ae48df694dd /challenge-258/sgreen/python/test.py
parent80a29b3bc4529d81f1a709fabab5ea1900eb679d (diff)
parentb5df38e77ecab31f91d505c4842ea3ae8c6a98ad (diff)
downloadperlweeklychallenge-club-40d47c8ead708860c4e3f21bae091506a42807f4.tar.gz
perlweeklychallenge-club-40d47c8ead708860c4e3f21bae091506a42807f4.tar.bz2
perlweeklychallenge-club-40d47c8ead708860c4e3f21bae091506a42807f4.zip
Merge branch 'master' of https://github.com/manwar/perlweeklychallenge-club
Diffstat (limited to 'challenge-258/sgreen/python/test.py')
-rwxr-xr-xchallenge-258/sgreen/python/test.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/challenge-258/sgreen/python/test.py b/challenge-258/sgreen/python/test.py
new file mode 100755
index 0000000000..25e8507722
--- /dev/null
+++ b/challenge-258/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.count_even_digits([10, 1, 111, 24, 1000]), 3)
+ self.assertEqual(ch_1.count_even_digits([111, 1, 11111]), 0)
+ self.assertEqual(ch_1.count_even_digits([2, 8, 1024, 256]), 1)
+
+ def test_ch_2(self):
+ self.assertEqual(ch_2.sum_of_values([2, 5, 9, 11, 3], 1), 17)
+ self.assertEqual(ch_2.sum_of_values([2, 5, 9, 11, 3], 2), 11)
+ self.assertEqual(ch_2.sum_of_values([2, 5, 9, 11, 3], 0), 2)
+
+
+if __name__ == '__main__':
+ unittest.main()