def read_request_headers(self): """Reads the request headers out of the underlying TTransportBase and return an FContext Returns: FContext """ headers = _Headers._read(self.get_transport()) context = FContext() for key, value in headers.items(): context._set_request_header(key, value) op_id = headers[_OPID_HEADER] context._set_response_op_id(op_id) cid = context.correlation_id if cid: context._set_response_header(_CID_HEADER, cid) return context
def test_op_id(self): context = FContext(self.correlation_id) context._set_request_header("_opid", "12345") self.assertEqual(self.correlation_id, context.correlation_id) self.assertEqual("12345", context.get_request_header("_opid"))