Merge "Fix test_rpc_consumer_isolation for oslo.messaging 5.31.0"
This commit is contained in:
@@ -118,7 +118,7 @@ class ServiceTestCase(test.NoDBTestCase):
|
||||
def test_init_and_start_hooks(self, mock_get_by_host_and_binary,
|
||||
mock_create):
|
||||
mock_get_by_host_and_binary.return_value = None
|
||||
mock_manager = mock.Mock()
|
||||
mock_manager = mock.Mock(target=None)
|
||||
serv = service.Service(self.host,
|
||||
self.binary,
|
||||
self.topic,
|
||||
@@ -195,7 +195,7 @@ class ServiceTestCase(test.NoDBTestCase):
|
||||
mock_get_by_host_and_binary,
|
||||
mock_create):
|
||||
mock_get_by_host_and_binary.return_value = None
|
||||
mock_manager = mock.Mock()
|
||||
mock_manager = mock.Mock(target=None)
|
||||
serv = service.Service(self.host,
|
||||
self.binary,
|
||||
self.topic,
|
||||
@@ -218,7 +218,7 @@ class ServiceTestCase(test.NoDBTestCase):
|
||||
@mock.patch('nova.objects.service.Service.get_by_host_and_binary')
|
||||
def test_parent_graceful_shutdown_with_cleanup_host(
|
||||
self, mock_svc_get_by_host_and_binary, mock_API):
|
||||
mock_manager = mock.Mock()
|
||||
mock_manager = mock.Mock(target=None)
|
||||
|
||||
serv = service.Service(self.host,
|
||||
self.binary,
|
||||
|
@@ -44,8 +44,13 @@ class IsolationTestCase(test.TestCase):
|
||||
def test_rpc_consumer_isolation(self):
|
||||
class NeverCalled(object):
|
||||
|
||||
def __getattribute__(*args):
|
||||
assert False, "I should never get called."
|
||||
def __getattribute__(self, name):
|
||||
if name == 'target':
|
||||
# oslo.messaging 5.31.0 explicitly looks for 'target'
|
||||
# on the endpoint and checks it's type, so we can't avoid
|
||||
# it here, just ignore it if that's the case.
|
||||
return
|
||||
assert False, "I should never get called. name: %s" % name
|
||||
|
||||
server = rpc.get_server(messaging.Target(topic='compute',
|
||||
server=CONF.host),
|
||||
|
Reference in New Issue
Block a user