Merge "Use get_rpc_transport instead of get_transport"

This commit is contained in:
Jenkins 2017-06-07 09:41:09 +00:00 committed by Gerrit Code Review
commit 58dea8a58f
2 changed files with 7 additions and 7 deletions

View File

@ -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)

View File

@ -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)