aboutsummaryrefslogtreecommitdiff
path: root/challenge-332/sgreen/python/test.py
diff options
context:
space:
mode:
authorMohammad Sajid Anwar <Mohammad.Anwar@yahoo.com>2025-08-03 23:13:16 +0100
committerGitHub <noreply@github.com>2025-08-03 23:13:16 +0100
commit8694075ce2d0d1115b8a67b6a2b20a996020519b (patch)
tree0e65be11a330dde67f502f3cec68973a1df07d63 /challenge-332/sgreen/python/test.py
parentd904375e9cf226c2c0465204e98b35fadf52be91 (diff)
parent39d8e45fc8a55d48a2b5bbceef09d7a2de1d846e (diff)
downloadperlweeklychallenge-club-8694075ce2d0d1115b8a67b6a2b20a996020519b.tar.gz
perlweeklychallenge-club-8694075ce2d0d1115b8a67b6a2b20a996020519b.tar.bz2
perlweeklychallenge-club-8694075ce2d0d1115b8a67b6a2b20a996020519b.zip
Merge pull request #12451 from simongreen-net/master
sgreen solutions to challenge 332
Diffstat (limited to 'challenge-332/sgreen/python/test.py')
-rwxr-xr-xchallenge-332/sgreen/python/test.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/challenge-332/sgreen/python/test.py b/challenge-332/sgreen/python/test.py
new file mode 100755
index 0000000000..3e0d5e5c53
--- /dev/null
+++ b/challenge-332/sgreen/python/test.py
@@ -0,0 +1,30 @@
+#!/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.binary_date('2025-07-26'),
+ '11111101001-111-11010'
+ )
+ self.assertEqual(
+ ch_1.binary_date('2000-02-02'),
+ '11111010000-10-10'
+ )
+ self.assertEqual(
+ ch_1.binary_date('2024-12-31'),
+ '11111101000-1100-11111'
+ )
+
+ def test_ch_2(self):
+ self.assertFalse(ch_2.odd_letters('weekly'))
+ self.assertTrue(ch_2.odd_letters('perl'))
+ self.assertFalse(ch_2.odd_letters('challenge'))
+
+
+if __name__ == '__main__':
+ unittest.main()