diff options
author | Haidong Ji | 2018-12-28 18:05:45 -0600 |
---|---|---|
committer | Haidong Ji | 2018-12-28 18:05:45 -0600 |
commit | 6eac7fac3f842cadb88b068635e17a79108897f6 (patch) | |
tree | bddd04c4bdad9682ed7955fa484cb2f0031ab4e3 /AlgoDesignAndTechniqueEdxPython/tests/placing_parenTest.py | |
parent | f32e2e8777d12869ce9e82aee1e3b9cc9e87f0f6 (diff) |
Diffstat (limited to 'AlgoDesignAndTechniqueEdxPython/tests/placing_parenTest.py')
-rw-r--r-- | AlgoDesignAndTechniqueEdxPython/tests/placing_parenTest.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/AlgoDesignAndTechniqueEdxPython/tests/placing_parenTest.py b/AlgoDesignAndTechniqueEdxPython/tests/placing_parenTest.py new file mode 100644 index 0000000..7463182 --- /dev/null +++ b/AlgoDesignAndTechniqueEdxPython/tests/placing_parenTest.py @@ -0,0 +1,32 @@ +''' +Created on Dec 28, 2018 + +@author: haidong +''' +import unittest + +from sources.placing_paren import getMaxValue + + +class Test(unittest.TestCase): + + def testName(self): + exp = "1+5" + self.assertEqual(6, getMaxValue(exp)) + + def testName1(self): + exp = "5-8+7*4-8+9" + self.assertEqual(200, getMaxValue(exp)) + + def testName2(self): + exp = "1+2-3*4-5" + self.assertEqual(6, getMaxValue(exp)) + + def testName3(self): + exp = "1+2*3" + self.assertEqual(9, getMaxValue(exp)) + + +if __name__ == "__main__": + # import sys;sys.argv = ['', 'Test.testName'] + unittest.main() |