def FetchResponse(self, path, method, headers, request_body):
    req_msg = http.HttpMessage()
    req_msg.start_line = \
      http.HttpClientToServerStartLine(method, path, http.HTTP_1_0)
    req_msg.headers = headers
    req_msg.body = request_body

    (_, _, _, resp_msg) = \
      http.server.HttpResponder(self.handler)(lambda: (req_msg, None))

    return (resp_msg.start_line.code, resp_msg.headers, resp_msg.body)
This is a callback method used to fetch a response.
dataset/ETHPy150Open ganeti/ganeti/lib/rapi/testutils.py/_RapiMock.FetchResponse