X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Ftests%2Funit%2Fservice%2Ftest_environment.py;h=779e6eaa03d212e3113b3dc0336a8644ac7d7bf0;hb=0ff5b131fa3f93f8d47b46c2f13661c5b88d37a1;hp=be4882e30a6486e5d13271a620bb7996cf4b1a14;hpb=9580bf1d0009b98b71d54c0a8231d45eae99d254;p=yardstick.git diff --git a/yardstick/tests/unit/service/test_environment.py b/yardstick/tests/unit/service/test_environment.py index be4882e30..779e6eaa0 100644 --- a/yardstick/tests/unit/service/test_environment.py +++ b/yardstick/tests/unit/service/test_environment.py @@ -9,9 +9,8 @@ import mock -from yardstick.common.exceptions import UnsupportedPodFormatError -from yardstick.service.environment import Environment -from yardstick.service.environment import AnsibleCommon +from yardstick.common import exceptions +from yardstick.service import environment from yardstick.tests.unit import base as ut_base @@ -31,15 +30,17 @@ class EnvironmentTestCase(ut_base.BaseUnitTestCase): ] } - with mock.patch.object(AnsibleCommon, 'gen_inventory_ini_dict'), \ - mock.patch.object(AnsibleCommon, 'get_sut_info', - return_value={'node1': {}}): - env = Environment(pod=pod_info) + with mock.patch.object(environment.AnsibleCommon, + 'gen_inventory_ini_dict'), \ + mock.patch.object(environment.AnsibleCommon, 'get_sut_info', + return_value={'node1': {}}), \ + mock.patch.object(environment.Environment, '_format_sut_info'): + env = environment.Environment(pod=pod_info) env.get_sut_info() def test_get_sut_info_pod_str(self): pod_info = 'nodes' - env = Environment(pod=pod_info) - with self.assertRaises(UnsupportedPodFormatError): + env = environment.Environment(pod=pod_info) + with self.assertRaises(exceptions.UnsupportedPodFormatError): env.get_sut_info()