Merge "Use get_rpc_transport instead of get_transport"
This commit is contained in:
commit
58dea8a58f
@ -36,8 +36,8 @@ EXTRA_EXMODS = []
|
||||
def init(conf):
|
||||
global TRANSPORT, NOTIFICATION_TRANSPORT, NOTIFIER
|
||||
exmods = get_allowed_exmods()
|
||||
TRANSPORT = messaging.get_transport(conf,
|
||||
allowed_remote_exmods=exmods)
|
||||
TRANSPORT = messaging.get_rpc_transport(conf,
|
||||
allowed_remote_exmods=exmods)
|
||||
NOTIFICATION_TRANSPORT = messaging.get_notification_transport(
|
||||
conf,
|
||||
allowed_remote_exmods=exmods)
|
||||
|
@ -27,15 +27,15 @@ class TestUtils(base.TestCase):
|
||||
@mock.patch.object(messaging, 'Notifier', autospec=True)
|
||||
@mock.patch.object(messaging, 'JsonPayloadSerializer', autospec=True)
|
||||
@mock.patch.object(messaging, 'get_notification_transport', autospec=True)
|
||||
@mock.patch.object(messaging, 'get_transport', autospec=True)
|
||||
def test_init_globals_notifications(self, mock_get_transport,
|
||||
@mock.patch.object(messaging, 'get_rpc_transport', autospec=True)
|
||||
def test_init_globals_notifications(self, mock_get_rpc_transport,
|
||||
mock_get_notification,
|
||||
mock_json_serializer,
|
||||
mock_notifier):
|
||||
self._test_init_globals(mock_get_transport, mock_get_notification,
|
||||
self._test_init_globals(mock_get_rpc_transport, mock_get_notification,
|
||||
mock_json_serializer, mock_notifier)
|
||||
|
||||
def _test_init_globals(self, mock_get_transport, mock_get_notification,
|
||||
def _test_init_globals(self, mock_get_rpc_transport, mock_get_notification,
|
||||
mock_json_serializer, mock_notifier):
|
||||
rpc.TRANSPORT = None
|
||||
rpc.NOTIFICATION_TRANSPORT = None
|
||||
@ -50,7 +50,7 @@ class TestUtils(base.TestCase):
|
||||
|
||||
rpc.init(CONF)
|
||||
|
||||
self.assertEqual(mock_get_transport.return_value, rpc.TRANSPORT)
|
||||
self.assertEqual(mock_get_rpc_transport.return_value, rpc.TRANSPORT)
|
||||
self.assertEqual(mock_get_notification.return_value,
|
||||
rpc.NOTIFICATION_TRANSPORT)
|
||||
self.assertTrue(mock_json_serializer.called)
|
||||
|
Loading…
Reference in New Issue
Block a user