|
@ -28,6 +28,9 @@ class read_function(unittest.TestCase): |
|
|
def test_read_math_function_false_if_enter_x(self, mock_input): |
|
|
def test_read_math_function_false_if_enter_x(self, mock_input): |
|
|
result = read_math_function() |
|
|
result = read_math_function() |
|
|
self.assertFalse(result) |
|
|
self.assertFalse(result) |
|
|
|
|
|
@patch('builtins.input', side_effect=["c", "5"]) |
|
|
|
|
|
def test_read_math_function_return5_if_enter_c_5(self, mock_input): |
|
|
|
|
|
self.assertEqual(read_math_function(), 5) |
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
if __name__ == '__main__': |
|
|
unittest.main() |
|
|
unittest.main() |