summaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorDeepak S <deepak.s@linux.intel.com>2017-06-19 12:19:41 +0000
committerRoss Brattain <ross.b.brattain@intel.com>2017-07-27 07:57:37 +0000
commit9000303d8df63f8d846b28c67ce1b45f16bb6c8b (patch)
tree43b407727422240a0ee69b2ea93bfe9085d6f66c /tests/unit
parentd184d8714e543e4f2497db682154820f7eecf1de (diff)
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 <deepak.s@linux.intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/benchmark/core/test_task.py14
1 files changed, 14 insertions, 0 deletions
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 = {