Esempio n. 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)
Esempio n. 2
0
 def test_basic_operations(self):
     operations = ['+', '-', '*', '/', '**']
     for op in operations:
         equation_str = 'x%sy' % op
         self.assertTrue(regex_check(equation_str))
Esempio n. 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))
Esempio n. 4
0
 def test_variables(self):
     for symbol in ('x', 'y'):
         self.assertTrue(regex_check(symbol))