def test_connectionLost(self): """ L{Request.finish} is not called when the connection is lost before rendering has finished. """ rendering = Deferred() class Res(Render): def renderHTTP(self, ctx): return rendering site = appserver.NevowSite(Res()) request = appserver.NevowRequest(testutil.FakeChannel(site), True) request.connectionLost(Exception("Just Testing")) rendering.callback(b"finished") self.assertFalse(request.finished, "Request was incorrectly marked as finished.")
def renderResource(self, resource, path): s = appserver.NevowSite(resource) r = appserver.NevowRequest(testutil.FakeChannel(s), True) r.path = path return r.process()