diff options
author | Luong Anh Tuan <tuanla@vn.fujitsu.com> | 2017-05-04 21:35:40 +0700 |
---|---|---|
committer | Tuan Luong-Anh <tuanla@vn.fujitsu.com> | 2017-05-29 10:53:24 +0000 |
commit | 9a78a83d9d3b3f756d71dd5f612dc0c6256e2a31 (patch) | |
tree | 2890824cdec8c7633ceb4c8d001e686b20062fe0 /heat/tests/common.py | |
parent | 25a143d89a9193874639af91867d057e84f72815 (diff) | |
download | heat-9a78a83d9d3b3f756d71dd5f612dc0c6256e2a31.tar.gz |
Using fixtures instead of deprecated mockpatch module
This module mockpatch of oslotest[1] is deprecated since version 1.13
and may be removed in version 2.0. Use fixtures.Mock* classes instead[2]
[1]OpenStack Testing Framework and Utilities
[2]https://docs.openstack.org/developer/oslotest/api/oslotest.mockpatch.html#module-oslotest.mockpatch
Change-Id: I844bd3ddb5ac6da4364c9034dcccdaa5265c1658
Diffstat (limited to 'heat/tests/common.py')
-rw-r--r-- | heat/tests/common.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/heat/tests/common.py b/heat/tests/common.py index 54bda0c0f..16d9a41ed 100644 --- a/heat/tests/common.py +++ b/heat/tests/common.py @@ -18,7 +18,6 @@ import fixtures import mox from oslo_config import cfg from oslo_log import log as logging -from oslotest import mockpatch import testscenarios import testtools @@ -203,14 +202,15 @@ class HeatTestCase(testscenarios.WithScenarios, generic_rsrc.ResourceWithHiddenPropertyAndAttribute) def patchobject(self, obj, attr, **kwargs): - mockfixture = self.useFixture(mockpatch.PatchObject(obj, attr, - **kwargs)) + mockfixture = self.useFixture(fixtures.MockPatchObject(obj, attr, + **kwargs)) return mockfixture.mock # NOTE(pshchelo): this overrides the testtools.TestCase.patch method # that does simple monkey-patching in favor of mock's patching def patch(self, target, **kwargs): - mockfixture = self.useFixture(mockpatch.Patch(target, **kwargs)) + mockfixture = self.useFixture(fixtures.MockPatch(target, + **kwargs)) return mockfixture.mock def stub_auth(self, ctx=None, **kwargs): |