Пример #1
0
 def test_malformed_equations(self):
     bad_equations = [
         'z',
         'xy',
     ]
     for bad_equation in bad_equations:
         with self.assertRaises(BadInputError):
             regex_check(bad_equation)
Пример #2
0
 def test_basic_operations(self):
     operations = ['+', '-', '*', '/', '**']
     for op in operations:
         equation_str = 'x%sy' % op
         self.assertTrue(regex_check(equation_str))
Пример #3
0
 def test_operations(self):
     operations = ['sin', 'cos', 'exp', 'log']
     for op in operations:
         equation_str = '%s(x)' % op
         self.assertTrue(regex_check(equation_str))
Пример #4
0
 def test_variables(self):
     for symbol in ('x', 'y'):
         self.assertTrue(regex_check(symbol))