def getResourceFor(self, root, url): r = testutil.FakeRequest() self.request = r r.postpath = url.split('/') deferred = util.maybeDeferred( appserver.NevowSite(root).getResourceFor, r) return util.deferredResult(deferred)
def getResourceFor(self, root, url): r = testutil.FakeRequest() self.request = r r.postpath = url.split('/') deferred = util.maybeDeferred(appserver.NevowSite(root).getResourceFor, r) return util.deferredResult( deferred )
def deferredRender(res): defres = req() d = res.renderHTTP( context.PageContext(tag=res, parent=context.RequestContext(tag=defres))) def accumulated(result, req): return req.accumulator return util.deferredResult(d.addCallback(accumulated, defres), timeout=1)
def deferredRender(res): defres = req() d = res.renderHTTP(context.PageContext(tag=res, parent=context.RequestContext(tag=defres))) def accumulated(result, req): return req.accumulator return util.deferredResult(d.addCallback(accumulated, defres), timeout=1)
def renderResource(self, resource, path): s = appserver.NevowSite(resource) r = appserver.NevowRequest(testutil.FakeChannel(s), True) r.path = path D = r.process() return util.deferredResult(D)