Stop printing in console when testing functest_utils.py
authorCédric Ollivier <cedric.ollivier@orange.com>
Tue, 23 May 2017 18:58:42 +0000 (20:58 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Tue, 23 May 2017 20:22:17 +0000 (22:22 +0200)
Change-Id: I6fa0f6f449270199cc4d5b2c88e171091bf92773
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
functest/tests/unit/utils/test_functest_utils.py

index 218f7f7..12604c1 100644 (file)
@@ -452,9 +452,8 @@ class FunctestUtilsTesting(unittest.TestCase):
             mock_logger_info.assert_called_once_with(msg_exec)
             mopen.assert_called_once_with(self.output_file, "w")
 
-    @mock.patch('functest.utils.functest_utils.logger.info')
-    def test_execute_command_args_missing_with_success(self, mock_logger_info,
-                                                       ):
+    @mock.patch('sys.stdout')
+    def test_execute_command_args_missing_with_success(self, stdout=None):
         with mock.patch('functest.utils.functest_utils.subprocess.Popen') \
                 as mock_subproc_open:
 
@@ -476,9 +475,8 @@ class FunctestUtilsTesting(unittest.TestCase):
                                                   output_file=None)
             self.assertEqual(resp, 0)
 
-    @mock.patch('functest.utils.functest_utils.logger.error')
-    def test_execute_command_args_missing_with_error(self, mock_logger_error,
-                                                     ):
+    @mock.patch('sys.stdout')
+    def test_execute_command_args_missing_with_error(self, stdout=None):
         with mock.patch('functest.utils.functest_utils.subprocess.Popen') \
                 as mock_subproc_open: