@mock.patch.object(rpc, 'RequestContextSerializer')
@mock.patch.object(messaging, 'get_rpc_server')
def test_get_server(self, mock_get, mock_ser):
    rpc.TRANSPORT = mock.Mock()
    ser = mock.Mock()
    tgt = mock.Mock()
    ends = mock.Mock()
    mock_ser.return_value = ser
    mock_get.return_value = 'server'
    server = rpc.get_server(tgt, ends, serializer='foo')
    mock_ser.assert_called_once_with('foo')
    access_policy = dispatcher.DefaultRPCAccessPolicy
    mock_get.assert_called_once_with(rpc.TRANSPORT, tgt, ends, 'eventlet', ser, access_policy=access_policy)
    self.assertEqual('server', server)
@mock.patch.object(rpc, 'RequestContextSerializer')
@mock.patch.object(messaging, 'get_rpc_server')
def test_get_server(self, mock_get, mock_ser):
    rpc.TRANSPORT = mock.Mock()
    ser = mock.Mock()
    tgt = mock.Mock()
    ends = mock.Mock()
    mock_ser.return_value = ser
    mock_get.return_value = 'server'
    server = rpc.get_server(tgt, ends, serializer='foo')
    mock_ser.assert_called_once_with('foo')
    access_policy = dispatcher.DefaultRPCAccessPolicy
    mock_get.assert_called_once_with(rpc.TRANSPORT, tgt, ends, 'eventlet', ser, access_policy=access_policy)
    self.assertEqual('server', server)