示例#1
0
 def route(request: IRequest) -> Deferred:
     sproc = SessionProcurer(mss)
     sessions.append((yield sproc.procureSession(request)))
     sessions.append((yield sproc.procureSession(request)))
     sessions.append((yield sproc.procureSession(request,
                                                 forceInsecure=True)))
     returnValue(b"sessioned")
示例#2
0
 def route(request: IRequest) -> Deferred:
     sproc = SessionProcurer(mss)
     request.write(b"oops...")
     with self.assertRaises(TooLateForCookies):
         yield sproc.procureSession(request)
     request.write(b"bye")
     request.finish()
示例#3
0
 def route(request: IRequest) -> Deferred:
     sproc = SessionProcurer(mss, setCookieOnGET=False)
     with self.assertRaises(NoSuchSession):
         yield sproc.procureSession(request)
     returnValue(b"no session")