Пример #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