From 9000303d8df63f8d846b28c67ce1b45f16bb6c8b Mon Sep 17 00:00:00 2001 From: Deepak S Date: Mon, 19 Jun 2017 12:19:41 +0000 Subject: Adding support for multi-dispatcher JIRA: YARDSTICK-684 This patch adds the support to enable multi-dispatcher of result. e.g. [DEFAULT] debug = False dispatcher = file, http Change-Id: Id0e1a1bba14edd899fcf5b275be1f0a091b6db77 Signed-off-by: Deepak S Signed-off-by: Ross Brattain --- tests/unit/benchmark/core/test_task.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') diff --git a/tests/unit/benchmark/core/test_task.py b/tests/unit/benchmark/core/test_task.py index 8d6d963c3..7f617537e 100644 --- a/tests/unit/benchmark/core/test_task.py +++ b/tests/unit/benchmark/core/test_task.py @@ -47,6 +47,20 @@ class TaskTestCase(unittest.TestCase): self.assertEqual(context_cfg["host"], server_info) self.assertEqual(context_cfg["target"], server_info) + def test_set_dispatchers(self): + t = task.Task() + output_config = {"DEFAULT": {"dispatcher": "file, http"}} + t._set_dispatchers(output_config) + self.assertEqual(output_config, output_config) + + @mock.patch('yardstick.benchmark.core.task.DispatcherBase') + def test__do_output(self, mock_dispatcher): + t = task.Task() + output_config = {"DEFAULT": {"dispatcher": "file, http"}} + mock_dispatcher.get = mock.MagicMock(return_value=[mock.MagicMock(), + mock.MagicMock()]) + self.assertEqual(None, t._do_output(output_config, {})) + @mock.patch('yardstick.benchmark.core.task.Context') def test_parse_networks_from_nodes(self, mock_context): nodes = { -- cgit 1.2.3-korg