aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/utils/test_functest_utils.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-03-11 19:16:09 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2018-03-11 20:06:54 +0100
commiteb973db776e77781c875d2640c4d59f878ba27c0 (patch)
treece1f9247c82a4ffce9c717cda35bed67c5d0c9de /functest/tests/unit/utils/test_functest_utils.py
parenta1a2fa10cd8cffbe7dc4cffec3446aafe73d87ba (diff)
Fix many pylint warnings
Only pylint warnings in vnf modules has to be fixed now. Change-Id: Ie71230072a51bb72ec0b1d4fef2652494d29948e Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/tests/unit/utils/test_functest_utils.py')
-rw-r--r--functest/tests/unit/utils/test_functest_utils.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/functest/tests/unit/utils/test_functest_utils.py b/functest/tests/unit/utils/test_functest_utils.py
index 77328fda8..d35ed8ced 100644
--- a/functest/tests/unit/utils/test_functest_utils.py
+++ b/functest/tests/unit/utils/test_functest_utils.py
@@ -20,6 +20,7 @@ from functest.utils import functest_utils
class FunctestUtilsTesting(unittest.TestCase):
+ # pylint: disable=too-many-instance-attributes
readline = 0
test_ip = ['10.1.23.4', '10.1.14.15', '10.1.16.15']
@@ -90,8 +91,8 @@ class FunctestUtilsTesting(unittest.TestCase):
@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):
+ def test_exec_cmd_args_present_ko(self, mock_logger_info,
+ mock_logger_error):
with mock.patch('functest.utils.functest_utils.subprocess.Popen') \
as mock_subproc_open, \
mock.patch('six.moves.builtins.open',
@@ -120,8 +121,7 @@ class FunctestUtilsTesting(unittest.TestCase):
mock_logger_error.assert_called_once_with(self.error_msg)
@mock.patch('functest.utils.functest_utils.LOGGER.info')
- def test_execute_command_args_present_with_success(self, mock_logger_info,
- ):
+ def test_exec_cmd_args_present_ok(self, mock_logger_info):
with mock.patch('functest.utils.functest_utils.subprocess.Popen') \
as mock_subproc_open, \
mock.patch('six.moves.builtins.open',
@@ -149,7 +149,8 @@ class FunctestUtilsTesting(unittest.TestCase):
mopen.assert_called_once_with(self.output_file, "w")
@mock.patch('sys.stdout')
- def test_execute_command_args_missing_with_success(self, stdout=None):
+ def test_exec_cmd_args_missing_ok(self, stdout=None):
+ # pylint: disable=unused-argument
with mock.patch('functest.utils.functest_utils.subprocess.Popen') \
as mock_subproc_open:
@@ -172,7 +173,8 @@ class FunctestUtilsTesting(unittest.TestCase):
self.assertEqual(resp, 0)
@mock.patch('sys.stdout')
- def test_execute_command_args_missing_with_error(self, stdout=None):
+ def test_exec_cmd_args_missing_ko(self, stdout=None):
+ # pylint: disable=unused-argument
with mock.patch('functest.utils.functest_utils.subprocess.Popen') \
as mock_subproc_open:
@@ -193,7 +195,7 @@ class FunctestUtilsTesting(unittest.TestCase):
output_file=None)
self.assertEqual(resp, 1)
- def test_get_parameter_from_yaml_failed(self):
+ def test_get_param_from_yaml_failed(self):
self.file_yaml['general'] = None
with mock.patch('six.moves.builtins.open', mock.mock_open()), \
mock.patch('functest.utils.functest_utils.yaml.safe_load') \
@@ -206,7 +208,7 @@ class FunctestUtilsTesting(unittest.TestCase):
" defined in config_functest.yaml" %
self.parameter) in excep.exception)
- def test_get_parameter_from_yaml_default(self):
+ def test_get_param_from_yaml_def(self):
with mock.patch('six.moves.builtins.open', mock.mock_open()), \
mock.patch('functest.utils.functest_utils.yaml.safe_load') \
as mock_yaml: