summaryrefslogtreecommitdiffstats
path: root/tests/unit/benchmark/core
diff options
context:
space:
mode:
authorchenjiankun <chenjiankun1@huawei.com>2017-08-09 03:23:58 +0000
committerchenjiankun <chenjiankun1@huawei.com>2017-08-11 09:29:58 +0000
commit43bf12d6ab7bcaea16dc75ed4ccbe3895cf51da3 (patch)
tree234d642e36564dab4e9d48cff09c0b93901c252f /tests/unit/benchmark/core
parent55234666785b0fdc81365da4dac5563e954f8a09 (diff)
Add real time log view in GUI
JIRA: YARDSTICK-775 We have GUI now, but we can't see real time log in GUI view. So I add real time log view in GUI. Change-Id: Ie83f327ef0a94302afa6b3def764fec6ef5818d1 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'tests/unit/benchmark/core')
-rw-r--r--tests/unit/benchmark/core/test_task.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/unit/benchmark/core/test_task.py b/tests/unit/benchmark/core/test_task.py
index 7f617537e..25688bf48 100644
--- a/tests/unit/benchmark/core/test_task.py
+++ b/tests/unit/benchmark/core/test_task.py
@@ -118,7 +118,8 @@ class TaskTestCase(unittest.TestCase):
},
])
- expected_get_network_calls = 4 # once for each vld_id in the nodes dict
+ # once for each vld_id in the nodes dict
+ expected_get_network_calls = 4
expected = {
'a': {'name': 'a', 'network_type': 'private'},
'b': {'name': 'b', 'vld_id': 'y', 'subnet_cidr': '10.20.0.0/16'},
@@ -289,6 +290,13 @@ class TaskTestCase(unittest.TestCase):
task.change_server_name(scenario, suffix)
self.assertTrue(scenario['target']['name'], 'demo-8')
+ @mock.patch('yardstick.benchmark.core.task.logging')
+ def test_set_log(self, mock_logging):
+ task_obj = task.Task()
+ task_obj.task_id = 'task_id'
+ task_obj._set_log()
+ self.assertTrue(mock_logging.root.addHandler.called)
+
def _get_file_abspath(self, filename):
curr_path = os.path.dirname(os.path.abspath(__file__))
file_path = os.path.join(curr_path, filename)