diff options
author | Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com> | 2018-07-23 10:19:38 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-07-23 10:19:38 +0000 |
commit | 29b6e112447ef79827de96414ec6d82c14ae9a37 (patch) | |
tree | 6d29946077d101e9c4431a7387f91f9d16460188 | |
parent | da95727e2a3a9e0f816f50b40202bb231c936231 (diff) | |
parent | 642f377558f55882880ea7818d5ad1849ba7fa38 (diff) |
Merge "Cleanup TaskParseTestCase unit tests"
-rw-r--r-- | yardstick/tests/unit/benchmark/core/test_task.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/yardstick/tests/unit/benchmark/core/test_task.py b/yardstick/tests/unit/benchmark/core/test_task.py index 35236637d..e1414c2ae 100644 --- a/yardstick/tests/unit/benchmark/core/test_task.py +++ b/yardstick/tests/unit/benchmark/core/test_task.py @@ -9,11 +9,13 @@ import copy import io +import logging import os import sys import mock import six +from six.moves import builtins import unittest import uuid @@ -322,9 +324,9 @@ class TaskTestCase(unittest.TestCase): actual_result = t._parse_options(options) self.assertEqual(expected_result, actual_result) - @mock.patch('six.moves.builtins.open', side_effect=mock.mock_open()) + @mock.patch.object(builtins, 'open', side_effect=mock.mock_open()) @mock.patch.object(task, 'utils') - @mock.patch('logging.root') + @mock.patch.object(logging, 'root') def test_set_log(self, mock_logging_root, *args): task_obj = task.Task() task_obj.task_id = 'task_id' @@ -561,7 +563,8 @@ key2: mock_open.assert_has_calls([mock.call('args_file'), mock.call('task_file')]) - def test__render_task_error_arguments(self): + @mock.patch.object(builtins, 'print') + def test__render_task_error_arguments(self, *args): with self.assertRaises(exceptions.TaskRenderArgumentError): task.TaskParser('task_file')._render_task('value1="var3"', None) |