From d4525399d41dd57f21bc11a67ceb63bdb16bc146 Mon Sep 17 00:00:00 2001 From: Simon Green Date: Sun, 11 Feb 2024 17:05:04 +1100 Subject: Simon's solution to challenge 255 --- challenge-255/sgreen/python/test.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 challenge-255/sgreen/python/test.py (limited to 'challenge-255/sgreen/python/test.py') diff --git a/challenge-255/sgreen/python/test.py b/challenge-255/sgreen/python/test.py new file mode 100755 index 0000000000..af2c369e5f --- /dev/null +++ b/challenge-255/sgreen/python/test.py @@ -0,0 +1,20 @@ +#!/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.odd_character('Perl', 'Preel'), 'e') + self.assertEqual(ch_1.odd_character('Weekly', 'Weeakly'), 'a') + self.assertEqual(ch_1.odd_character('Box', 'Boxy'), 'y') + + def test_ch_2(self): + self.assertEqual(ch_2.most_frequent_word('Joe hit a ball, the hit ball flew far after it was hit.', 'hit'), 'ball') + self.assertEqual(ch_2.most_frequent_word('Perl and Raku belong to the same family. Perl is the most popular language in the weekly challenge.', 'the'), 'perl') + + +if __name__ == '__main__': + unittest.main() -- cgit