Example #1
0
    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)
Example #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)
Example #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)
Example #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)
Example #5
0
    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)
Example #6
0
 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"
Example #7
0
 def test_create_endpoint_no_process(self):
     prpc = ProcessRPCClient()
     self.assertRaises(StandardError, prpc.create_endpoint)
Example #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)
Example #9
0
 def create_endpoint(self, to_name=None, existing_channel=None, **kwargs):
     return ProcessRPCClient.create_endpoint(self, to_name,
                                             existing_channel, **kwargs)
Example #10
0
 def create_endpoint(self, to_name=None, existing_channel=None, **kwargs):
     return ProcessRPCClient.create_endpoint(self, to_name, existing_channel, **kwargs)