def testDelayedDisconnectDoesNotFinishRequest(self):
"""
A C{CancelledError} exception is raised if content cannot be read
from the request midway through processing, due to the client
disconnecting. In such cases, the C{Request.finish} method is not
invoked by the L{handleRequestError} handler to avoid causing a
failure in Twisted.
"""
failure = Failure(CancelledError("Client disconnected partway."))
handleRequestError(failure, self.request, self.resource)
self.assertFalse(self.request.finished)
评论列表
文章目录