mò 0á¸Ec@sldZdkZdkZdkZdkZdkZdkZdeifd„ƒYZdfd„ƒYZ dS(sœSupport for functional unit testing in ZTC After Marius Gedminas' functional.py module for Zope3. $Id: functional.py 38608 2005-09-25 08:44:20Z tseaver $ Nt FunctionalcBs5tZdZeifZeeedeed„ZRS(sžDerive from this class and an xTestCase to get functional testing support:: class MyTest(Functional, ZopeTestCase): ... tGETc Cs¼dkl} dkl} dkl}dkl}dkl} |ƒ}t i ƒ|djo h}n|djo h}n|ii}|d|d<|d|d<||d<|id ƒ}t|ƒd jo|d |d /data/zmath/zope/lib/python/Testing/ZopeTestCase/functional.pytpublish$sH                   ( t__name__t __module__t__doc__t interfacest IFunctionalt__implements__RtTrueR1(((R0Rs  R/cBsitZdZeideieiBƒZd„Zd„Z d„Z d„Z d„Z d„Z d„ZRS( sBDecorates a response object with additional introspective methods.s^$^ (.*)cCs||_||_||_dS(N(R Rt _responseR,t _outstreamR$t_path(RR R,R$((R0t__init__ds  cCst|i|ƒS(N(tgetattrRR9tname(RR>((R0t __getattr__iscCs |iiƒS(s-Returns the complete output, headers and all.N(RR:tgetvalue(R((R0t getOutputlscCs<|ii|iƒƒ}|dj o|idƒ}n|S(s3Returns the page body, i.e. the output par headers.iN(Rt_bodyretsearchRAtbodyRtgroup(RRD((R0tgetBodyps  cCs|iS(s%Returns the path used by the request.N(RR;(R((R0tgetPathwscCs|ii|iƒƒS(s'Returns the value of a response header.N(RtheaderstgetR>tlower(RR>((R0t getHeader{scCs|ii|ƒS(sReturns a response cookie.N(RtcookiesRIR>(RR>((R0t getCookies(R2R3R4tretcompilet MULTILINEtDOTALLRBR<R?RARFRGRKRM(((R0R/_s       ( R4R-RNR*RtsandboxR5t SandboxedRR/(RR5R*RR-RNRRR/((R0Rs    E