diff options
| author | Simon Green <mail@simon.green> | 2024-06-23 23:18:19 +1000 |
|---|---|---|
| committer | Simon Green <mail@simon.green> | 2024-06-23 23:18:19 +1000 |
| commit | 11d250df98a2ee69b3ca1f89019704433fba9579 (patch) | |
| tree | 1d9b82a94f37e5fdd97f41cfeb3b412c96c3586c /challenge-274/sgreen/python/test.py | |
| parent | 41c7a18ce09761c310487d6af3e2f224cc43a161 (diff) | |
| download | perlweeklychallenge-club-11d250df98a2ee69b3ca1f89019704433fba9579.tar.gz perlweeklychallenge-club-11d250df98a2ee69b3ca1f89019704433fba9579.tar.bz2 perlweeklychallenge-club-11d250df98a2ee69b3ca1f89019704433fba9579.zip | |
sgreen solutions to challenge 274
Diffstat (limited to 'challenge-274/sgreen/python/test.py')
| -rwxr-xr-x | challenge-274/sgreen/python/test.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/challenge-274/sgreen/python/test.py b/challenge-274/sgreen/python/test.py new file mode 100755 index 0000000000..16ef8c1661 --- /dev/null +++ b/challenge-274/sgreen/python/test.py @@ -0,0 +1,37 @@ +#!/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.goat_latin('I love Perl'), + 'Imaa ovelmaaa erlPmaaaa' + ) + self.assertEqual( + ch_1.goat_latin('Perl and Raku are friends'), + 'erlPmaa andmaaa akuRmaaaa aremaaaaa riendsfmaaaaaa' + ) + self.assertEqual( + ch_1.goat_latin('The Weekly Challenge'), + 'heTmaa eeklyWmaaa hallengeCmaaaa' + ) + + def test_ch_2(self): + self.assertEqual( + ch_2.bus_route([ch_2.Route(12, 11, 41), ch_2.Route(15, 5, 35)]), + [36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47] + ) + self.assertEqual( + ch_2.bus_route([ch_2.Route(12, 3, 41), ch_2.Route( + 15, 9, 35), ch_2.Route(30, 5, 25)]), + [0, 1, 2, 3, 25, 26, 27, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 55, 56, 57, 58, 59] + ) + + +if __name__ == '__main__': + unittest.main() |
