Ñò ô†³Kc@sïdZddkZddkTdefd„ƒYZdddd„ZedjošddkZddk l Z ee ƒZ d e i Z d „Zd ed ƒjpt‚d edƒjpt‚e idƒe iƒeie ƒndS(s‚ WSGI Test Server This builds upon paste.util.baseserver to customize it for regressions where using raw_interactive won't do. iÿÿÿÿN(t*tWSGIRegressionServercBsVeZdZdZd„Zd„Zd„Zd„Zd„Zd„Z dd „Z RS( sN A threaded WSGIServer for use in regression testing. To use this module, call serve(application, regression=True), and then call server.accept() to let it handle one request. When finished, use server.stop() to shutdown the server. Note that all pending requests are processed before the server shuts down. i cOsEti|||Žg|_g|_|i|_|iidƒdS(Ni(t WSGIServert__init__tstoppingtpendingtdefaulttimeoutttimeouttsockett settimeout(tselftargstkwargs((s:/usr/lib/python2.6/site-packages/paste/debug/testserver.pyRs    cCs0ddkl}|d|iƒ}|iƒdS(Niÿÿÿÿ(tThreadttarget(t threadingR t serve_pendingtstart(R R tthread((s:/usr/lib/python2.6/site-packages/paste/debug/testserver.pyt serve_forever scCs(|iotiƒ|i|_ndS(N(Rttimetexpires(R ((s:/usr/lib/python2.6/site-packages/paste/debug/testserver.pyt reset_expires$s cOs.ti|||Ž|iiƒ|iƒdS(N(Rt close_requestRtpopR(R R R ((s:/usr/lib/python2.6/site-packages/paste/debug/testserver.pyR's cCs€|iƒxo|i p |ioYtiƒ}||ijo|io dGHPn|io|iƒntidƒq WdS(Ns0 WARNING: WSGIRegressionServer timeout exceeded gš™™™™™¹?(RRRRRRthandle_requesttsleep(R tnow((s:/usr/lib/python2.6/site-packages/paste/debug/testserver.pyR+s   cCs|iitƒdS(s/ stop the server (called from tester's thread) N(RtappendtTrue(R ((s:/usr/lib/python2.6/site-packages/paste/debug/testserver.pytstop7sicCsG|i pt‚g}t|ƒD]}||iitƒq#~dS(s6 accept another request (called from tester's thread) N(RtAssertionErrortrangeRRR(R tcountt_[1]tx((s:/usr/lib/python2.6/site-packages/paste/debug/testserver.pytaccept:s( t__name__t __module__t__doc__RRRRRRRR$(((s:/usr/lib/python2.6/site-packages/paste/debug/testserver.pyRs     cCs/t||||ƒ}d|iGH|iƒ|S(Nsserving on %s:%s(Rtserver_addressR(t applicationthosttportthandlertserver((s:/usr/lib/python2.6/site-packages/paste/debug/testserver.pytserve?s  t__main__(t dump_environs http://%s:%scCs=tidƒddk}|idƒtit|ƒiƒS(Niiÿÿÿÿi(R-R$Rtsetdefaulttimeoutturllibturlopentbaseuritread(tpathR((s:/usr/lib/python2.6/site-packages/paste/debug/testserver.pytfetchKs   sPATH_INFO: /foos/foosPATH_INFO: /wombles/womblei(R'Rtpaste.httpserverRRtNoneR.R%R2t paste.wsgilibR0R-R(R4R7RR$RR3(((s:/usr/lib/python2.6/site-packages/paste/debug/testserver.pyt s  /