@ -45,3 +45,7 @@ def calculate_constant_string(string):
return eval(string)
except Exception as e:
return f"Fehler bei der Berechnung: {str(e)}"
def simplify_easy_math_function(type, function):
if type != "v":
return False
@ -32,5 +32,8 @@ class read_function(unittest.TestCase):
def test_read_math_function_return5_if_enter_c_5(self, mock_input):
self.assertEqual(read_math_function(), 5)
def test_easy_function_wrong_type(self):
self.assertEqual(simplify_easy_math_function("a", "42x"), False)
if __name__ == '__main__':
unittest.main()