From 11d250df98a2ee69b3ca1f89019704433fba9579 Mon Sep 17 00:00:00 2001 From: Simon Green Date: Sun, 23 Jun 2024 23:18:19 +1000 Subject: sgreen solutions to challenge 274 --- challenge-274/sgreen/python/test.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 challenge-274/sgreen/python/test.py (limited to 'challenge-274/sgreen/python/test.py') 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() -- cgit