From 61ffe2a9e5fd066dae82a32185bbfe821696bd8a Mon Sep 17 00:00:00 2001 From: Haidong Ji Date: Tue, 25 Dec 2018 16:42:27 -0600 Subject: Longest subsequence done! (3 seqs) The only tricky part was to create and populate the 3-d list. The instructions here was helpful: https://www.ict.social/python/basics/multidimensional-lists-in-python--- AlgoDesignAndTechniqueEdxPython/tests/lcs3Test.py | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 AlgoDesignAndTechniqueEdxPython/tests/lcs3Test.py (limited to 'AlgoDesignAndTechniqueEdxPython/tests/lcs3Test.py') diff --git a/AlgoDesignAndTechniqueEdxPython/tests/lcs3Test.py b/AlgoDesignAndTechniqueEdxPython/tests/lcs3Test.py new file mode 100644 index 0000000..c5cf51e --- /dev/null +++ b/AlgoDesignAndTechniqueEdxPython/tests/lcs3Test.py @@ -0,0 +1,28 @@ +''' +Created on Dec 25, 2018 + +@author: haidong +''' +import unittest + +from sources.lcs3 import getLCS3 + + +class Test(unittest.TestCase): + + def testName(self): + a = [1, 2, 3] + b = [2, 1, 3] + c = [1, 3, 5] + self.assertEqual(2, getLCS3(a, b, c)) + + def testName1(self): + a = [8, 3, 2, 1, 7] + b = [8, 2, 1, 3, 8, 10, 7] + c = [6, 8, 3, 1, 4, 7] + self.assertEqual(3, getLCS3(a, b, c)) + + +if __name__ == "__main__": + # import sys;sys.argv = ['', 'Test.testName'] + unittest.main() -- cgit v1.2.3