

@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 = ends
    mock_get.return_value = 'server'
    server = rpc.get_server(tgt, ends, serializer='foo')
    mock_ser.assert_called_once_with('foo')
    mock_get.assert_called_once_with(rpc.TRANSPORT, tgt, ends, executor='eventlet', serializer=ser)
    self.assertEqual('server', server)

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/test_rpc.py TestRPC.test_get_server/VarMisuse@76/98 `ser`->`ends`