Merge "Remove deprecated oslotest.mockpatch usage"
This commit is contained in:
commit
5503d44ee5
@ -14,7 +14,6 @@ import logging
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
import fixtures
|
import fixtures
|
||||||
from oslotest import mockpatch
|
|
||||||
import testscenarios
|
import testscenarios
|
||||||
import testtools
|
import testtools
|
||||||
|
|
||||||
@ -67,12 +66,12 @@ class BileanTestCase(testscenarios.WithScenarios,
|
|||||||
self.addCleanup(utils.reset_dummy_db)
|
self.addCleanup(utils.reset_dummy_db)
|
||||||
|
|
||||||
def patchobject(self, obj, attr, **kwargs):
|
def patchobject(self, obj, attr, **kwargs):
|
||||||
mockfixture = self.useFixture(mockpatch.PatchObject(obj, attr,
|
mockfixture = self.useFixture(fixtures.MockPatchObject(obj, attr,
|
||||||
**kwargs))
|
**kwargs))
|
||||||
return mockfixture.mock
|
return mockfixture.mock
|
||||||
|
|
||||||
# NOTE(pshchelo): this overrides the testtools.TestCase.patch method
|
# NOTE(pshchelo): this overrides the testtools.TestCase.patch method
|
||||||
# that does simple monkey-patching in favor of mock's patching
|
# that does simple monkey-patching in favor of mock's patching
|
||||||
def patch(self, target, **kwargs):
|
def patch(self, target, **kwargs):
|
||||||
mockfixture = self.useFixture(mockpatch.Patch(target, **kwargs))
|
mockfixture = self.useFixture(fixtures.MockPatch(target, **kwargs))
|
||||||
return mockfixture.mock
|
return mockfixture.mock
|
||||||
|
Loading…
x
Reference in New Issue
Block a user