Exemplo n.º 1
0
    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.")
Exemplo n.º 2
0
 def renderResource(self, resource, path):
     s = appserver.NevowSite(resource)
     r = appserver.NevowRequest(testutil.FakeChannel(s), True)
     r.path = path
     return r.process()