summaryrefslogtreecommitdiff
path: root/AlgoDesignAndTechniqueEdxPython/tests/partition3Test.py
blob: a5aea66f0b92357866fd6a76f0fec1de274c5f75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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()