Пример #1
0
    def test__build_header(self, mockr, mockp):

        mockr.return_value = {'one':1, 'two':2}
        mockp.return_value = {'two':-2, 'three':3}

        ep = ProcessRPCRequestEndpointUnit()
        header = ep._build_header(sentinel.raw_msg, {})

        self.assertEquals(header, {'one':1, 'two':-2, 'three':3})
Пример #2
0
    def test__build_header(self, mockr, mockp):

        mockr.return_value = {'one': 1, 'two': 2}
        mockp.return_value = {'two': -2, 'three': 3}

        ep = ProcessRPCRequestEndpointUnit()
        header = ep._build_header(sentinel.raw_msg)

        self.assertEquals(header, {'one': 1, 'two': -2, 'three': 3})
Пример #3
0
    def _get_response(self, conv_id, timeout):
        result_data, result_headers = ProcessRPCRequestEndpointUnit._get_response(self, conv_id, timeout)

        if "conv-msg-type" in result_headers:
            c = self.participant.get_conversation_endpoint(conv_id)
            if c:
                c._msg_received(result_data, result_headers)

        return result_data, result_headers
Пример #4
0
    def _get_response(self, conv_id, timeout):
        result_data, result_headers = ProcessRPCRequestEndpointUnit._get_response(
            self, conv_id, timeout)

        if 'conv-msg-type' in result_headers:
            c = self.participant.get_conversation_endpoint(conv_id)
            if c:
                c._msg_received(result_data, result_headers)

        return result_data, result_headers
Пример #5
0
    def test_init(self, mockr, mockp):

        ep = ProcessRPCRequestEndpointUnit(process=sentinel.process,
                                           other=sentinel.other)
        mockp.assert_called_once_with(ep, process=sentinel.process)
        mockr.assert_called_once_with(ep, other=sentinel.other)
Пример #6
0
 def _message_send(self, msg, headers=None, **kwargs):
     return ProcessRPCRequestEndpointUnit.send(self, msg, headers, **kwargs)
Пример #7
0
 def __init__(self, **kwargs):
     ProcessRPCRequestEndpointUnit.__init__(self, **kwargs)
Пример #8
0
 def _message_send(self, msg, headers=None, **kwargs):
     return ProcessRPCRequestEndpointUnit.send(self, msg, headers, **kwargs)
Пример #9
0
 def __init__(self, **kwargs):
     ProcessRPCRequestEndpointUnit.__init__(self, **kwargs)