Use fixtures instead of deprecated mockpatch module

The mockpatch module of oslotest is deprecated since version 1.13
and may be removed in version 2.0. Use fixtures.Mock* classes instead.

Change-Id: I0ea834d41664efe84aa28ef2362467e2ad8b1928
This commit is contained in:
rajat29 2017-08-22 12:23:49 +05:30 committed by Rajat Sharma
parent 5cb6ad8c2a
commit 674dfb000c
1 changed files with 2 additions and 3 deletions

View File

@ -14,9 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import fixtures
from oslotest import base
from oslotest import mockpatch
class TestCase(base.BaseTestCase):
@ -24,5 +23,5 @@ class TestCase(base.BaseTestCase):
def patch(self, obj, attr):
"""Returns a Mocked object on the patched attribute."""
mockfixture = self.useFixture(mockpatch.PatchObject(obj, attr))
mockfixture = self.useFixture(fixtures.MockPatchObject(obj, attr))
return mockfixture.mock