From c6092cb676363d89f366dc9a416ba6c53eeea33f Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Fri, 26 Jan 2018 14:29:01 +0100 Subject: Fix pylint errors in several utils modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All utils which are moving to xtesting are now fixed. It remains OpenStack and Functest utils (+ the related unit tests) which doesn't move to the new package. Change-Id: If13c627c8444c62d5c6bf9c8057d6413aa0e56c7 Signed-off-by: Cédric Ollivier --- functest/tests/unit/utils/test_functest_utils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'functest/tests/unit') diff --git a/functest/tests/unit/utils/test_functest_utils.py b/functest/tests/unit/utils/test_functest_utils.py index 4438c6a2..218d03c4 100644 --- a/functest/tests/unit/utils/test_functest_utils.py +++ b/functest/tests/unit/utils/test_functest_utils.py @@ -10,12 +10,12 @@ # pylint: disable=missing-docstring import logging -import pkg_resources import os import time import unittest import mock +import pkg_resources from six.moves import urllib from functest.utils import functest_utils @@ -147,8 +147,8 @@ class FunctestUtilsTesting(unittest.TestCase): def cmd_readline(self): return 'test_value\n' - @mock.patch('functest.utils.functest_utils.logger.error') - @mock.patch('functest.utils.functest_utils.logger.info') + @mock.patch('functest.utils.functest_utils.LOGGER.error') + @mock.patch('functest.utils.functest_utils.LOGGER.info') def test_execute_command_args_present_with_error(self, mock_logger_info, mock_logger_error): with mock.patch('functest.utils.functest_utils.subprocess.Popen') \ @@ -178,7 +178,7 @@ class FunctestUtilsTesting(unittest.TestCase): mopen.assert_called_once_with(self.output_file, "w") mock_logger_error.assert_called_once_with(self.error_msg) - @mock.patch('functest.utils.functest_utils.logger.info') + @mock.patch('functest.utils.functest_utils.LOGGER.info') def test_execute_command_args_present_with_success(self, mock_logger_info, ): with mock.patch('functest.utils.functest_utils.subprocess.Popen') \ @@ -255,7 +255,7 @@ class FunctestUtilsTesting(unittest.TestCase): def _get_functest_config(self, var): return var - @mock.patch('functest.utils.functest_utils.logger.error') + @mock.patch('functest.utils.functest_utils.LOGGER.error') def test_get_dict_by_test(self, mock_logger_error): with mock.patch('six.moves.builtins.open', mock.mock_open()), \ mock.patch('functest.utils.functest_utils.yaml.safe_load') \ @@ -321,7 +321,7 @@ class FunctestUtilsTesting(unittest.TestCase): resp = functest_utils.get_functest_yaml() self.assertEqual(resp, self.file_yaml) - @mock.patch('functest.utils.functest_utils.logger.info') + @mock.patch('functest.utils.functest_utils.LOGGER.info') def test_print_separator(self, mock_logger_info): functest_utils.print_separator() mock_logger_info.assert_called_once_with("=======================" -- cgit 1.2.3-korg