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)
Exemple #2
0
    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)
Exemple #3
0
    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)
Exemple #4
0
    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"
Exemple #7
0
 def test_create_endpoint_no_process(self):
     prpc = ProcessRPCClient()
     self.assertRaises(StandardError, prpc.create_endpoint)
Exemple #8
0
    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)
Exemple #9
0
 def create_endpoint(self, to_name=None, existing_channel=None, **kwargs):
     return ProcessRPCClient.create_endpoint(self, to_name,
                                             existing_channel, **kwargs)
Exemple #10
0
 def create_endpoint(self, to_name=None, existing_channel=None, **kwargs):
     return ProcessRPCClient.create_endpoint(self, to_name, existing_channel, **kwargs)