Merge "Stop using mox in unit/fake_processutils.py"

This commit is contained in:
Jenkins 2016-10-14 16:24:17 +00:00 committed by Gerrit Code Review
commit ab93877efd
3 changed files with 12 additions and 12 deletions

View File

@ -101,7 +101,7 @@ def fake_execute(*cmd_parts, **kwargs):
return reply
def stub_out_processutils_execute(stubs):
def stub_out_processutils_execute(test):
fake_execute_set_repliers([])
fake_execute_clear_log()
stubs.Set(processutils, 'execute', fake_execute)
test.stub_out('oslo_concurrency.processutils.execute', fake_execute)

View File

@ -101,7 +101,7 @@ class _ImageTestCase(object):
CONF.set_override('preallocate_images', 'space')
fake_processutils.fake_execute_clear_log()
fake_processutils.stub_out_processutils_execute(self.stubs)
fake_processutils.stub_out_processutils_execute(self)
image = self.image_class(self.INSTANCE, self.NAME)
def fake_fetch(target, *args, **kwargs):
@ -124,7 +124,7 @@ class _ImageTestCase(object):
CONF.set_override('preallocate_images', 'space')
fake_processutils.fake_execute_clear_log()
fake_processutils.stub_out_processutils_execute(self.stubs)
fake_processutils.stub_out_processutils_execute(self)
image = self.image_class(self.INSTANCE, self.NAME)
def fake_fetch(target, *args, **kwargs):
@ -798,7 +798,7 @@ class LvmTestCase(_ImageTestCase, test.NoDBTestCase):
CONF.set_override('preallocate_images', 'space')
fake_processutils.fake_execute_clear_log()
fake_processutils.stub_out_processutils_execute(self.stubs)
fake_processutils.stub_out_processutils_execute(self)
image = self.image_class(self.INSTANCE, self.NAME)
def fake_fetch(target, *args, **kwargs):
@ -1167,7 +1167,7 @@ class EncryptedLvmTestCase(_ImageTestCase, test.NoDBTestCase):
def test_prealloc_image(self):
self.flags(preallocate_images='space')
fake_processutils.fake_execute_clear_log()
fake_processutils.stub_out_processutils_execute(self.stubs)
fake_processutils.stub_out_processutils_execute(self)
image = self.image_class(self.INSTANCE, self.NAME)
def fake_fetch(target, *args, **kwargs):
@ -1281,7 +1281,7 @@ class RbdTestCase(_ImageTestCase, test.NoDBTestCase):
rbd_utils.rbd.RBD_FEATURE_LAYERING = 1
fake_processutils.fake_execute_clear_log()
fake_processutils.stub_out_processutils_execute(self.stubs)
fake_processutils.stub_out_processutils_execute(self)
image = self.image_class(self.INSTANCE, self.NAME)
self.mox.StubOutWithMock(image, 'exists')
@ -1307,7 +1307,7 @@ class RbdTestCase(_ImageTestCase, test.NoDBTestCase):
rbd_utils.rbd.RBD_FEATURE_LAYERING = 1
fake_processutils.fake_execute_clear_log()
fake_processutils.stub_out_processutils_execute(self.stubs)
fake_processutils.stub_out_processutils_execute(self)
image = self.image_class(self.INSTANCE, self.NAME)
self.mox.StubOutWithMock(image, 'exists')
@ -1355,7 +1355,7 @@ class RbdTestCase(_ImageTestCase, test.NoDBTestCase):
CONF.set_override('preallocate_images', 'space')
fake_processutils.fake_execute_clear_log()
fake_processutils.stub_out_processutils_execute(self.stubs)
fake_processutils.stub_out_processutils_execute(self)
image = self.image_class(self.INSTANCE, self.NAME)
def fake_fetch(target, *args, **kwargs):
@ -1664,7 +1664,7 @@ class PloopTestCase(_ImageTestCase, test.NoDBTestCase):
def test_prealloc_image(self):
self.flags(preallocate_images='space')
fake_processutils.fake_execute_clear_log()
fake_processutils.stub_out_processutils_execute(self.stubs)
fake_processutils.stub_out_processutils_execute(self)
image = self.image_class(self.INSTANCE, self.NAME)
def fake_fetch(target, *args, **kwargs):

View File

@ -297,7 +297,7 @@ class XenAPIVMTestCase(stubs.XenAPITestBase):
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
stubs.stubout_get_this_vm_uuid(self.stubs)
stubs.stub_out_vm_methods(self.stubs)
fake_processutils.stub_out_processutils_execute(self.stubs)
fake_processutils.stub_out_processutils_execute(self)
self.user_id = 'fake'
self.project_id = fakes.FAKE_PROJECT_ID
self.context = context.RequestContext(self.user_id, self.project_id)
@ -1686,7 +1686,7 @@ class XenAPIMigrateInstance(stubs.XenAPITestBase):
self.migration = db.migration_create(
context.get_admin_context(), migration_values)
fake_processutils.stub_out_processutils_execute(self.stubs)
fake_processutils.stub_out_processutils_execute(self)
stubs.stub_out_migration_methods(self.stubs)
stubs.stubout_get_this_vm_uuid(self.stubs)