|
@ -1,6 +1,6 @@ |
|
|
import unittest |
|
|
import unittest |
|
|
from src.main.py.read_math_function import * |
|
|
from src.main.py.read_math_function import * |
|
|
|
|
|
|
|
|
|
|
|
from unittest.mock import patch |
|
|
|
|
|
|
|
|
class read_function(unittest.TestCase): |
|
|
class read_function(unittest.TestCase): |
|
|
def test_constant_without_calculation(self): |
|
|
def test_constant_without_calculation(self): |
|
@ -24,5 +24,10 @@ class read_function(unittest.TestCase): |
|
|
def test_constant_string_not_allowed_decision(self): |
|
|
def test_constant_string_not_allowed_decision(self): |
|
|
self.assertEqual(simplify_constant("c", "42^(2)+1-3*4/3x"), False) |
|
|
self.assertEqual(simplify_constant("c", "42^(2)+1-3*4/3x"), False) |
|
|
|
|
|
|
|
|
|
|
|
@patch('builtins.input', side_effect=["x"]) |
|
|
|
|
|
def test_read_math_function_false_if_enter_x(self, mock_input): |
|
|
|
|
|
result = read_math_function() |
|
|
|
|
|
self.assertFalse(result) |
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
if __name__ == '__main__': |
|
|
unittest.main() |
|
|
unittest.main() |