

def _stub_rpc_method(self, rpc_method, result):
    call_info = {
        
    }
    orig_prepare = self.cells_rpcapi.client.prepare

    def fake_rpc_prepare(**kwargs):
        if ('version' in kwargs):
            call_info['version'] = kwargs.pop('version')
        return self.cells_rpcapi.client

    def fake_csv(version):
        return orig_prepare(version).can_send_version()

    def fake_rpc_method(ctxt, method, **kwargs):
        call_info['context'] = ctxt
        call_info['method'] = method
        call_info['args'] = kwargs
        return result
    self.stubs.Set(self.cells_rpcapi.client, 'prepare', fake_rpc_prepare)
    call_info.stubs.Set(self.cells_rpcapi.client, 'can_send_version', fake_csv)
    self.stubs.Set(self.cells_rpcapi.client, rpc_method, fake_rpc_method)
    return call_info

dataset/ETHPy150Open openstack/nova/nova/tests/unit/cells/test_cells_rpcapi.py CellsAPITestCase._stub_rpc_method/VarMisuse@147/197 `self`->`call_info`