blob: 746318266c8e5697678868cc3b7d3d5631f9256f (
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
29
30
31
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()
|