From 78f896dd625fbbfe33fbd88b55790e55bf0dd57f Mon Sep 17 00:00:00 2001 From: Simon Green Date: Sun, 11 May 2025 11:31:25 +1000 Subject: sgreen solutions to challenge 320 --- challenge-320/sgreen/python/test.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 challenge-320/sgreen/python/test.py (limited to 'challenge-320/sgreen/python/test.py') diff --git a/challenge-320/sgreen/python/test.py b/challenge-320/sgreen/python/test.py new file mode 100755 index 0000000000..81900ad922 --- /dev/null +++ b/challenge-320/sgreen/python/test.py @@ -0,0 +1,21 @@ +#!/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.maximum_count([-3, -2, -1, 1, 2, 3]), 3) + self.assertEqual(ch_1.maximum_count([-2, -1, 0, 0, 1]), 2) + self.assertEqual(ch_1.maximum_count([1, 2, 3, 4]), 4) + + def test_ch_2(self): + self.assertEqual(ch_2.sum_difference([1, 23, 4, 5]), 18) + self.assertEqual(ch_2.sum_difference([1, 2, 3, 4, 5]), 0) + self.assertEqual(ch_2.sum_difference([1, 2, 34]), 27) + + +if __name__ == '__main__': + unittest.main() -- cgit