def test_create_endpoint(self, mockce): prpc = ProcessRPCClient(process=sentinel.process) sentinel.process.container = Mock() sentinel.process.container.create_service_xn = Mock(return_value=sentinel.to_name) prpc.create_endpoint(to_name=sentinel.to_name) mockce.assert_called_once_with(prpc, sentinel.to_name, None, process=sentinel.process)
def test_create_endpoint(self, mockce): prpc = ProcessRPCClient(process=sentinel.process) prpc.create_endpoint(to_name=sentinel.to_name) mockce.assert_called_once_with(prpc, sentinel.to_name, None, process=sentinel.process)
def __init__(self, **kwargs): ProcessRPCClient.__init__(self, **kwargs) self._conv_type = RPCConversationType() if hasattr(self._process, 'name'): self._participant = Participant(self._process.name) else: self._participant = Participant(self._send_name)
def __init__(self, **kwargs): ProcessRPCClient.__init__(self, **kwargs) self._conv_type = RPCConversationType() if hasattr(self._process, "name"): self._participant = Participant(self._process.name) else: self._participant = Participant(self._send_name)
def test_create_endpoint(self, mockce): prpc = ProcessRPCClient(process=sentinel.process) sentinel.process.container = Mock() sentinel.process.container.create_service_xn = Mock( return_value=sentinel.to_name) prpc.create_endpoint(to_name=sentinel.to_name) mockce.assert_called_once_with(prpc, sentinel.to_name, None, process=sentinel.process)
def register(self, user_name='', proc_id=''): print "Registering user %s, client %s" % (user_name, proc_id) client = ProcessRPCClient(node=self.container.node, name=proc_id, iface=IChatcService, process=self) self.clients[user_name] = DotDict(procid=proc_id, user_name=user_name, client=client) return "OK"
def test_create_endpoint_no_process(self): prpc = ProcessRPCClient() self.assertRaises(StandardError, prpc.create_endpoint)
def create_endpoint(self, to_name=None, existing_channel=None, **kwargs): return ProcessRPCClient.create_endpoint(self, to_name, existing_channel, **kwargs)