|
@ -15,6 +15,8 @@ class read_function(unittest.TestCase): |
|
|
self.assertEqual(is_allowed_string("c", "42^(2)+1-3*4/3"), True) |
|
|
self.assertEqual(is_allowed_string("c", "42^(2)+1-3*4/3"), True) |
|
|
def test_constant_isallowed_string_false(self): |
|
|
def test_constant_isallowed_string_false(self): |
|
|
self.assertEqual(is_allowed_string("c", "42^(2)+1-3*4/3x"), False) |
|
|
self.assertEqual(is_allowed_string("c", "42^(2)+1-3*4/3x"), False) |
|
|
|
|
|
def test_constant_calculate_without_pow(self): |
|
|
|
|
|
self.assertEqual(calculate_string("42+1-3*4/3"), 39) |
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
if __name__ == '__main__': |
|
|
unittest.main() |
|
|
unittest.main() |