1 ##############################################################################
2 # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
12 from yardstick.common.exceptions import UnsupportedPodFormatError
13 from yardstick.service.environment import Environment
14 from yardstick.service.environment import AnsibleCommon
15 from yardstick.tests.unit import base as ut_base
18 class EnvironmentTestCase(ut_base.BaseUnitTestCase):
20 def test_get_sut_info(self):
34 with mock.patch.object(AnsibleCommon, 'gen_inventory_ini_dict'), \
35 mock.patch.object(AnsibleCommon, 'get_sut_info',
36 return_value={'node1': {}}):
37 env = Environment(pod=pod_info)
40 def test_get_sut_info_pod_str(self):
43 env = Environment(pod=pod_info)
44 with self.assertRaises(UnsupportedPodFormatError):