def make_request(method, path): req = Request(FakeChannel(), None) req.prepath = req.postpath = None req.method = method req.path = path resource = site.getChildWithDefault(path, req) return resource.render(req)
def makeRequest(method, path, post_data=None): req = Request(FakeChannel(), None) req.prepath = req.postpath = None req.method = method req.path = path req.content = StringIO(post_data) resource = site.getChildWithDefault(path, req) return resource.render(req)
def mk_request(path=None, headers=None): request = Request(channel=None, queued=True) if path: request.path = path if headers: for k, v in headers.items(): request.requestHeaders.addRawHeader(k, v) return request
def getRequest(method, url): import warnings msg = 'These tests will be removed in a future release of the txrestserver' warnings.warn(msg, DeprecationWarning) req = Request(FakeChannel(), None) req.method = method req.path = url return req
def get_request(self, method, uri, clientproto, headers, data, response): self.transport = response.transport r = Request(self, False) r.method = method r.clientproto = clientproto r.path = uri r.client = response.client r.host = self.host r.prepath = [] r.postpath = map(unquote, string.split(r.path[1:], "/")) r.content = StringIO.StringIO(data) r.transport = response.transport return r
def getRequest(method, url): req = Request(FakeChannel(), None) req.method = method req.path = url return req