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})
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})
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
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
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)
def _message_send(self, msg, headers=None, **kwargs): return ProcessRPCRequestEndpointUnit.send(self, msg, headers, **kwargs)
def __init__(self, **kwargs): ProcessRPCRequestEndpointUnit.__init__(self, **kwargs)