def test_malformed_equations(self): bad_equations = [ 'z', 'xy', ] for bad_equation in bad_equations: with self.assertRaises(BadInputError): regex_check(bad_equation)
def test_basic_operations(self): operations = ['+', '-', '*', '/', '**'] for op in operations: equation_str = 'x%sy' % op self.assertTrue(regex_check(equation_str))
def test_operations(self): operations = ['sin', 'cos', 'exp', 'log'] for op in operations: equation_str = '%s(x)' % op self.assertTrue(regex_check(equation_str))
def test_variables(self): for symbol in ('x', 'y'): self.assertTrue(regex_check(symbol))