예제 #1
0
 def test_division_before_addition(self):
     assert math_expr.evaluate('2 + 4 / 2') == 4
예제 #2
0
 def test_division_before_subtraction(self):
     assert math_expr.evaluate('2 - 4 / 2') == 0
예제 #3
0
 def test_multiplication_before_addition(self):
     assert math_expr.evaluate('1 + 1 * 2') == 3
예제 #4
0
 def test_multiplication_before_subtraction(self):
     assert math_expr.evaluate('2 - 1 * 2') == 0
예제 #5
0
 def test_parentheses(self):
     assert math_expr.evaluate('(1 + 1) * 2') == 4
예제 #6
0
 def test_division(self):
     assert math_expr.evaluate('4 / 2') == 2
예제 #7
0
 def test_multiplication(self):
     assert math_expr.evaluate('2 * 2') == 4
예제 #8
0
 def test_subtraction(self):
     assert math_expr.evaluate('1 - 1') == 0
예제 #9
0
 def test_addition(self):
     assert math_expr.evaluate('1 + 1') == 2