aboutsummaryrefslogtreecommitdiff
path: root/challenge-274/sgreen/python/test.py
diff options
context:
space:
mode:
authorMohammad Sajid Anwar <Mohammad.Anwar@yahoo.com>2024-06-23 17:10:44 +0100
committerGitHub <noreply@github.com>2024-06-23 17:10:44 +0100
commitac35991ec21e719113a463c6a0f66a66b76e4651 (patch)
tree2a837ebedef59eb328749acb68e9ec1c238f869a /challenge-274/sgreen/python/test.py
parent3f34fb89b87951ad5581033268b43c459aac4e79 (diff)
parent1bc07771fae64d8b4ddf0d3e5fffd706d559624e (diff)
downloadperlweeklychallenge-club-ac35991ec21e719113a463c6a0f66a66b76e4651.tar.gz
perlweeklychallenge-club-ac35991ec21e719113a463c6a0f66a66b76e4651.tar.bz2
perlweeklychallenge-club-ac35991ec21e719113a463c6a0f66a66b76e4651.zip
Merge pull request #10303 from simongreen-net/master
sgreen solutions to challenge 274
Diffstat (limited to 'challenge-274/sgreen/python/test.py')
-rwxr-xr-xchallenge-274/sgreen/python/test.py37
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()