Exemple #1
0
 def test_eval_exp(self):
     res = calc.eval_exp("2*3+4")
     self.assertEqual(res,10)
Exemple #2
0
 def test_eval_exp(self):
     res = calc.eval_exp([3,operator.add,4])
     self.assertEqual(res,7)
     # 3-1+2==4
     res2 = calc.eval_exp([3,operator.sub,1,operator.add,2])
     self.assertEqual(res2,4)