Don't mock oslo.messaging _CallContext
This is a private method, rather mock the wrapping heat method.
Change-Id: I364723846b8851bbaec4f35aff3ccd708c40417f
Closes-bug: 1412836
(cherry-picked from d1ca5b6ccc
)
This commit is contained in:
parent
97bd3cca35
commit
a194a88d2a
|
@ -22,8 +22,6 @@ from eventlet import event as grevent
|
|||
import mock
|
||||
import mox
|
||||
from oslo.config import cfg
|
||||
from oslo import messaging
|
||||
from oslo.messaging.rpc import client as rpc_client
|
||||
from oslo.messaging.rpc import dispatcher
|
||||
import six
|
||||
|
||||
|
@ -842,11 +840,11 @@ class StackServiceCreateUpdateDeleteTest(HeatTestCase):
|
|||
stack_lock.StackLock.engine_alive(self.ctx, "other-engine-fake-uuid")\
|
||||
.AndReturn(True)
|
||||
|
||||
self.m.StubOutWithMock(rpc_client._CallContext, 'call')
|
||||
rpc_client._CallContext.call(
|
||||
self.ctx, 'stop_stack',
|
||||
self.m.StubOutWithMock(self.man, '_remote_call')
|
||||
self.man._remote_call(
|
||||
self.ctx, 'other-engine-fake-uuid', 'stop_stack',
|
||||
stack_identity=mox.IgnoreArg()
|
||||
).AndRaise(messaging.MessagingTimeout)
|
||||
).AndReturn(False)
|
||||
self.m.ReplayAll()
|
||||
|
||||
ex = self.assertRaises(dispatcher.ExpectedException,
|
||||
|
@ -875,9 +873,9 @@ class StackServiceCreateUpdateDeleteTest(HeatTestCase):
|
|||
stack_lock.StackLock.engine_alive(self.ctx, "other-engine-fake-uuid")\
|
||||
.AndReturn(True)
|
||||
|
||||
self.m.StubOutWithMock(rpc_client._CallContext, 'call')
|
||||
rpc_client._CallContext.call(
|
||||
self.ctx, 'stop_stack',
|
||||
self.m.StubOutWithMock(self.man, '_remote_call')
|
||||
self.man._remote_call(
|
||||
self.ctx, 'other-engine-fake-uuid', 'stop_stack',
|
||||
stack_identity=mox.IgnoreArg()).AndReturn(None)
|
||||
|
||||
self.m.StubOutWithMock(stack_lock.StackLock, 'acquire')
|
||||
|
|
Loading…
Reference in New Issue