diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2023-05-07 23:03:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-07 23:03:32 +0100 |
| commit | 4d4ab5e767a03427c536b71ed66609db08d6e019 (patch) | |
| tree | ca28d14d1c60314899fdf942f6a64c297500b7a6 /challenge-215/lance-wicks/python/OddOneOut-tests.py | |
| parent | 8b888166e201c95ff6aa94817d9bf90678cd8a02 (diff) | |
| parent | 987b0225e4b17bd14e7f73c484573e42c92a7463 (diff) | |
| download | perlweeklychallenge-club-4d4ab5e767a03427c536b71ed66609db08d6e019.tar.gz perlweeklychallenge-club-4d4ab5e767a03427c536b71ed66609db08d6e019.tar.bz2 perlweeklychallenge-club-4d4ab5e767a03427c536b71ed66609db08d6e019.zip | |
Merge pull request #8026 from lancew/215-lw-python
Python attempt at challenge 215
Diffstat (limited to 'challenge-215/lance-wicks/python/OddOneOut-tests.py')
| -rw-r--r-- | challenge-215/lance-wicks/python/OddOneOut-tests.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/challenge-215/lance-wicks/python/OddOneOut-tests.py b/challenge-215/lance-wicks/python/OddOneOut-tests.py new file mode 100644 index 0000000000..26d476520f --- /dev/null +++ b/challenge-215/lance-wicks/python/OddOneOut-tests.py @@ -0,0 +1,24 @@ +import unittest + +from oddoneout import * + +class TestNotAlphaOrder(unittest.TestCase): + + def test_order_one(self): + self.assertFalse(is_not_alpha_order('abc')) + def test_order_two(self): + self.assertTrue(is_not_alpha_order('cba')) + +class TestCount(unittest.TestCase): + def test_count_example_one(self): + words = ['abc', 'xyz', 'tsu'] + self.assertEqual(count(words),1) + def test_count_example_two(self): + words = ['rat', 'cab', 'dad'] + self.assertEqual(count(words),3) + def test_count_example_three(self): + words = ['x', 'y', 'z'] + self.assertEqual(count(words),0) + +if __name__ == '__main__': + unittest.main() |
