3 ##############################################################################
4 # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
12 # Unittest for yardstick.cmd.commands.task
17 from yardstick.cmd.commands import task
20 class TaskCommandsTestCase(unittest.TestCase):
22 @mock.patch('yardstick.cmd.commands.task.Context')
23 def test_parse_nodes_host_target_same_context(self, mock_context):
28 scenario_cfg = {"nodes": nodes}
32 "key_filename": "/root/.ssh/id_rsa"
34 mock_context.get_server.return_value = server_info
35 context_cfg = task.parse_nodes_with_context(scenario_cfg)
37 self.assertEqual(context_cfg["host"], server_info)
38 self.assertEqual(context_cfg["target"], server_info)