summaryrefslogtreecommitdiff
path: root/AlgoDesignAndTechniqueEdxPython/tests/partition3Test.py
diff options
context:
space:
mode:
Diffstat (limited to 'AlgoDesignAndTechniqueEdxPython/tests/partition3Test.py')
-rw-r--r--AlgoDesignAndTechniqueEdxPython/tests/partition3Test.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/AlgoDesignAndTechniqueEdxPython/tests/partition3Test.py b/AlgoDesignAndTechniqueEdxPython/tests/partition3Test.py
new file mode 100644
index 0000000..a5aea66
--- /dev/null
+++ b/AlgoDesignAndTechniqueEdxPython/tests/partition3Test.py
@@ -0,0 +1,28 @@
+'''
+Created on Dec 27, 2018
+
+@author: haidong
+'''
+import unittest
+
+from sources.partition3 import getPartition3
+
+
+class Test(unittest.TestCase):
+
+ def testName(self):
+ a = [3, 3, 3, 3]
+ self.assertEqual(0, getPartition3(a))
+
+ def testName1(self):
+ a = [30]
+ self.assertEqual(0, getPartition3(a))
+
+ def testName2(self):
+ a = [1, 2, 3, 4, 5, 5, 7, 7, 8, 10, 12, 19, 25]
+ self.assertEqual(1, getPartition3(a))
+
+
+if __name__ == "__main__":
+ # import sys;sys.argv = ['', 'Test.testName']
+ unittest.main()