ó 0`’Lc@sÏdZddlZddlZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z y6ddl mZmZmZdefd„ƒYZWn!ek rßddlmZnXeaeae jZd „Zd ejfd „ƒYZd efd „ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZ defd„ƒYZ!defd„ƒYZ"defd„ƒYZ#defd„ƒYZ$defd„ƒYZ%d efd!„ƒYZ&d"efd#„ƒYZ'd$efd%„ƒYZ(d&efd'„ƒYZ)d(efd)„ƒYZ*d*efd+„ƒYZ+d,efd-„ƒYZ,d.efd/„ƒYZ-d0„Z.d1„Z/e0d2krËe/ƒndS(3sv Tests for the 'cheetah' command. Besides unittest usage, recognizes the following command-line options: --list CheetahWrapper.py List all scenarios that are tested. The argument is the path of this script. --nodelete Don't delete scratch directory at end. --output Show the output of each subcommand. (Normally suppressed.) iÿÿÿÿN(t OptionParser(tCheetahWrapper(tPopentPIPEtSTDOUTtPopen4cBs#eZdeeeeed„ZRS(iÿÿÿÿc Ksett|ƒj|d|d|d|d|d|d|||j|_|j|_|j|_dS(Ntbufsizetshellt close_fdststdintstdouttstderr( tsuperRt__init__R ttochildR t fromchildR tchilderr( tselftcmdRRRR R R tkwargs((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR s !   (t__name__t __module__tTrueRRR (((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRs (RcCstjj|dƒdS(Ns (tsysR twrite(tmsg((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pytwarn/stCFBasecBs¤eZdZdZdZdZeZd„Zd„Z d „Z d „Z d „Z d „Z d „Zd„Zd„Zd„Zd„Zed„Zddd„ZRS(sDBase class for "cheetah compile" and "cheetah fill" unit tests. ttchildschild/grandkidsa.tmpls child/a.tmplschild/grandkid/a.tmplcCs|jr|GHndS(N(tverbose(Rtmessage((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pytinform:s cCs|jdƒ|_tjƒ}tjjdƒs@|tjds$      cCsctj|jƒtrNtj|jtƒtjj |jƒr_t dƒq_nt d|jƒdS(Ns.Warning: unable to delete scratch directory %ss*Warning: not deleting scratch directory %s( R%R.R-tDELETEtshutiltrmtreeR+RtpathtexistsR(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyttearDownYs c Cs®tjj|ƒ}tjj|ƒ}d|}|j||ƒt|dƒ}|jƒ}|jƒ|r|j|ƒdk} n ||k} |t ƒ}|j| |ƒdS(sÒLow-level helper to check a destination file. in : path, string, the destination path. expected, string, the expected contents. allowSurroundingtext, bool, allow the result to contain additional text around the 'expected' substring? errmsg, string, the error message. It may contain the following "%"-operator keys: path, expected, result. out: None sdestination file missing: %striÿÿÿÿN( R%R=tabspathR>t failUnlessR2treadR3tfindtlocals( RR=texpectedtallowSurroundingTextterrmsgR>RR8tresulttsuccess((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyt_checkDestFileHelpercs      cCs&d}d}|j||t|ƒdS(Ns Hello, world!sJdestination file %(path)s doesn't contain expected substring: %(expected)r(RKR(RR=RFRH((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyt checkCompile~scCs&d}d}|j||t|ƒdS(NsHello, world! sWdestination file %(path)s contains wrong result. Expected %(expected)r Found %(result)r(RKtFalse(RR=RFRH((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyt checkFillˆscCsqtjj|ƒ}d|}|j||ƒtjj|dƒ}tjj|ƒ}d|}|j||ƒdS(s^Verify a destination subdirectory exists and contains an __init__.py file. s$destination subdirectory %s misssings __init__.pys!destination init file missing: %sN(R%R=R>RBtjoin(RR=R>RtinitPath((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pytcheckSubdirPyInit‘s  cCs0tjj|ƒ}d|}|j||ƒdS(s>Verify 'path' does not exist. (To check --nobackup.) s-backup file exists in spite of --nobackup: %sN(R%R=R>tfailIf(RR=R>R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyt checkNoBackupžs cCs‰tjdƒ}|s|S|jdƒ}|jdƒ}xK|D]C}tjj||ƒ}tjj|ƒ}tjj|ƒr>|Sq>W|S(NtPATHt t:(R%tgetenvtsplitR=RORAtisfile(RRtpathstpartstp((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR$¥s cCsVtj|ƒ\}}|jƒ|jƒ}|jƒ}|dkrLd}n||fS(Ni(R%tpopen4R3RCtNone(RRt_int_outtoutputtrc((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pytassertWin32Subprocess²s     cCsi|jd|jƒ}t|dtjƒ}|jjƒ|jjƒ}|j ƒ}|jjƒ||fS(NR!tenv( treplaceRRR%R'RR3RRCtwait(RRtprocessRatstatus((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pytassertPosixSubprocess»s   cCsd\}}tjdkr3|j|ƒ\}}n|j|ƒ\}}|sn|j|dd||fƒn|j|dd||fƒ|S(Ntwin32isLSubprocess exited with a non-zero status (%d) %ssHSubprocess exited with a zero status (%d) %s(NN(R^RtplatformRcRitfailUnlessEqualt failIfEqual(RRtnonzeroRhRa((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pytassertSubprocessÄs   icCsW|j|ƒ}|dk rSd||f}|j|ƒdk}|j||ƒndS(sÓRun a "cheetah compile" or "cheetah fill" subcommand. in : cmd, string, the command to run. expectedStatus, int, subcommand's expected output status. 0 if the subcommand is expected to succeed, 1-255 otherwise. expectedOutputSubstring, string, substring which much appear in the standard output or standard error. None to skip this test. out: None. s/substring %r not found in subcommand output: %siÿÿÿÿN(RoR^RDRB(RRtexpectedStatustexpectedOutputSubstringRaRt substringTest((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pytgoÓs   (schildschild/grandkid(sa.tmpls child/a.tmplschild/grandkid/a.tmplN(RRt__doc__R/R0R1RMt expectErrorR R9R?RKRLRNRQRSR$RcRiRoR^Rs(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR2s$     t CFIdirBasecBs eZdZdZdZdZRS( s$Subclass for tests with --idir. tSRCs SRC/childsSRC/child/grandkids SRC/a.tmplsSRC/child/a.tmplsSRC/child/grandkid/a.tmpl(s SRC/childsSRC/child/grandkid(s SRC/a.tmplsSRC/child/a.tmplsSRC/child/grandkid/a.tmpl(RRRtR/R0R1(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRvæstOneFilecBs#eZd„Zd„Zd„ZRS(cCs|jdƒ|jdƒdS(Nscheetah compile a.tmplsa.py(RsRL(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyt testCompileós cCs|jdƒ|jdƒdS(Nscheetah fill a.tmplsa.html(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyttestFill÷s cCs|jdƒ|jdƒdS(Nscheetah fill --oext txt a.tmplsa.txt(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyttestTextûs (RRRyRzR{(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRxòs  tOneFileNoExtensioncBs#eZd„Zd„Zd„ZRS(cCs|jdƒ|jdƒdS(Nscheetah compile asa.py(RsRL(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRys cCs|jdƒ|jdƒdS(Nscheetah fill asa.html(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRzs cCs|jdƒ|jdƒdS(Nscheetah fill --oext txt asa.txt(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR{ s (RRRyRzR{(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR|s  t SplatTmplcBs#eZd„Zd„Zd„ZRS(cCs|jdƒ|jdƒdS(Nscheetah compile *.tmplsa.py(RsRL(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRys cCs|jdƒ|jdƒdS(Nscheetah fill *.tmplsa.html(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRzs cCs|jdƒ|jdƒdS(Nscheetah fill --oext txt *.tmplsa.txt(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR{s (RRRyRzR{(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR}s  tThreeFilesWithSubdirectoriescBs#eZd„Zd„Zd„ZRS(cCs8|jdƒ|jdƒ|jdƒ|jdƒdS(Ns9cheetah compile a.tmpl child/a.tmpl child/grandkid/a.tmplsa.pys child/a.pyschild/grandkid/a.py(RsRL(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRys   cCs8|jdƒ|jdƒ|jdƒ|jdƒdS(Ns6cheetah fill a.tmpl child/a.tmpl child/grandkid/a.tmplsa.htmls child/a.htmlschild/grandkid/a.html(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRz"s   cCs8|jdƒ|jdƒ|jdƒ|jdƒdS(NsAcheetah fill --oext txt a.tmpl child/a.tmpl child/grandkid/a.tmplsa.txts child/a.txtschild/grandkid/a.txt(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR{(s   (RRRyRzR{(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR~s  t'ThreeFilesWithSubdirectoriesNoExtensioncBs#eZd„Zd„Zd„ZRS(cCs8|jdƒ|jdƒ|jdƒ|jdƒdS(Ns*cheetah compile a child/a child/grandkid/asa.pys child/a.pyschild/grandkid/a.py(RsRL(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRy0s   cCs8|jdƒ|jdƒ|jdƒ|jdƒdS(Ns'cheetah fill a child/a child/grandkid/asa.htmls child/a.htmlschild/grandkid/a.html(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRz6s   cCs8|jdƒ|jdƒ|jdƒ|jdƒdS(Ns2cheetah fill --oext txt a child/a child/grandkid/asa.txts child/a.txtschild/grandkid/a.txt(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR{<s   (RRRyRzR{(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR/s  tSplatTmplWithSubdirectoriescBs#eZd„Zd„Zd„ZRS(cCs8|jdƒ|jdƒ|jdƒ|jdƒdS(Ns9cheetah compile *.tmpl child/*.tmpl child/grandkid/*.tmplsa.pys child/a.pyschild/grandkid/a.py(RsRL(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRyDs   cCs8|jdƒ|jdƒ|jdƒ|jdƒdS(Ns6cheetah fill *.tmpl child/*.tmpl child/grandkid/*.tmplsa.htmls child/a.htmlschild/grandkid/a.html(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRzJs   cCs8|jdƒ|jdƒ|jdƒ|jdƒdS(NsAcheetah fill --oext txt *.tmpl child/*.tmpl child/grandkid/*.tmplsa.txts child/a.txtschild/grandkid/a.txt(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR{Ps   (RRRyRzR{(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR€Cs  tOneFileWithOdircBs#eZd„Zd„Zd„ZRS(cCs+|jdƒ|jdƒ|jdƒdS(Ns"cheetah compile --odir DEST a.tmpltDESTs DEST/a.py(RsRQRL(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRyXs  cCs|jdƒ|jdƒdS(Nscheetah fill --odir DEST a.tmpls DEST/a.html(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRz]s cCs|jdƒ|jdƒdS(Ns*cheetah fill --odir DEST --oext txt a.tmpls DEST/a.txt(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR{as (RRRyRzR{(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRWs  tVarietyWithOdircBs#eZd„Zd„Zd„ZRS(cCs_|jdƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdƒdS(Ns@cheetah compile --odir DEST a.tmpl child/a child/grandkid/*.tmplR‚s DEST/childsDEST/child/grandkids DEST/a.pysDEST/child/a.pysDEST/child/grandkid/a.py(RsRQRL(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRygs      cCs8|jdƒ|jdƒ|jdƒ|jdƒdS(Ns=cheetah fill --odir DEST a.tmpl child/a child/grandkid/*.tmpls DEST/a.htmlsDEST/child/a.htmlsDEST/child/grandkid/a.html(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRzps   cCs8|jdƒ|jdƒ|jdƒ|jdƒdS(NsHcheetah fill --odir DEST --oext txt a.tmpl child/a child/grandkid/*.tmpls DEST/a.txtsDEST/child/a.txtsDEST/child/grandkid/a.txt(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR{vs   (RRRyRzR{(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRƒfs tRecurseExplicitcBs#eZd„Zd„Zd„ZRS(cCs+|jdƒ|jdƒ|jdƒdS(Nscheetah compile -R childs child/a.pyschild/grandkid/a.py(RsRL(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRy~s  cCs+|jdƒ|jdƒ|jdƒdS(Nscheetah fill -R childs child/a.htmlschild/grandkid/a.html(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRzƒs  cCs+|jdƒ|jdƒ|jdƒdS(Ns cheetah fill -R --oext txt childs child/a.txtschild/grandkid/a.txt(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR{ˆs  (RRRyRzR{(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR„}s  tRecurseImplicitcBs#eZd„Zd„Zd„ZRS(cCs+|jdƒ|jdƒ|jdƒdS(Nscheetah compile -Rs child/a.pyschild/grandkid/a.py(RsRL(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRys  cCs8|jdƒ|jdƒ|jdƒ|jdƒdS(Nscheetah fill -Rsa.htmls child/a.htmlschild/grandkid/a.html(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRz”s   cCs8|jdƒ|jdƒ|jdƒ|jdƒdS(Nscheetah fill -R --oext txtsa.txts child/a.txtschild/grandkid/a.txt(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR{šs   (RRRyRzR{(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR…Žs  tRecurseExplicitWIthOdircBs#eZd„Zd„Zd„ZRS(cCsE|jdƒ|jdƒ|jdƒ|jdƒ|jdƒdS(Ns$cheetah compile -R --odir DEST childs DEST/childsDEST/child/grandkidsDEST/child/a.pysDEST/child/grandkid/a.py(RsRQRL(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRy¢s     cCs+|jdƒ|jdƒ|jdƒdS(Ns!cheetah fill -R --odir DEST childsDEST/child/a.htmlsDEST/child/grandkid/a.html(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRz©s  cCs+|jdƒ|jdƒ|jdƒdS(Ns,cheetah fill -R --odir DEST --oext txt childsDEST/child/a.txtsDEST/child/grandkid/a.txt(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR{®s  (RRRyRzR{(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR†¡s  tFlatcBs#eZd„Zd„Zd„ZRS(cCs|jdƒ|jdƒdS(Ns#cheetah compile --flat child/a.tmplsa.py(RsRL(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRyµs cCs|jdƒ|jdƒdS(Ns cheetah fill --flat child/a.tmplsa.html(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRz¹s cCs|jdƒ|jdƒdS(Ns+cheetah fill --flat --oext txt child/a.tmplsa.txt(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR{½s (RRRyRzR{(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR‡´s  tFlatRecurseCollisioncBs)eZeZd„Zd„Zd„ZRS(cCs|jddtƒdS(Nscheetah compile -R --flatRn(RoR(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRyÅscCs|jddtƒdS(Nscheetah fill -R --flatRn(RoR(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRzÈscCs|jddtƒdS(Nscheetah fill -R --flatRn(RoR(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR{Ës(RRRRuRyRzR{(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRˆÂs  t IdirRecursecBs#eZd„Zd„Zd„ZRS(cCsE|jdƒ|jdƒ|jdƒ|jdƒ|jdƒdS(Ns#cheetah compile -R --idir SRC childRschild/grandkids child/a.pyschild/grandkid/a.py(RsRQRL(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRyÐs     cCs+|jdƒ|jdƒ|jdƒdS(Ns cheetah fill -R --idir SRC childs child/a.htmlschild/grandkid/a.html(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRz×s  cCs+|jdƒ|jdƒ|jdƒdS(Ns+cheetah fill -R --idir SRC --oext txt childs child/a.txtschild/grandkid/a.txt(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR{Üs  (RRRyRzR{(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR‰Ïs  tIdirOdirRecursecBs#eZd„Zd„Zd„ZRS(cCsE|jdƒ|jdƒ|jdƒ|jdƒ|jdƒdS(Ns/cheetah compile -R --idir SRC --odir DEST childs DEST/childsDEST/child/grandkidsDEST/child/a.pysDEST/child/grandkid/a.py(RsRQRL(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRyãs     cCs+|jdƒ|jdƒ|jdƒdS(Ns,cheetah fill -R --idir SRC --odir DEST childsDEST/child/a.htmlsDEST/child/grandkid/a.html(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRzês  cCs+|jdƒ|jdƒ|jdƒdS(Ns7cheetah fill -R --idir SRC --odir DEST --oext txt childsDEST/child/a.txtsDEST/child/grandkid/a.txt(RsRN(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR{ïs  (RRRyRzR{(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRŠâs  tIdirFlatRecurseCollisioncBs)eZeZd„Zd„Zd„ZRS(cCs|jddtƒdS(Ns$cheetah compile -R --flat --idir SRCRn(RoR(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRyøscCs|jddtƒdS(Ns!cheetah fill -R --flat --idir SRCRn(RoR(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRzûscCs|jddtƒdS(Ns,cheetah fill -R --flat --idir SRC --oext txtRn(RoR(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR{þs(RRRRuRyRzR{(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR‹õs  tNoBackupcBs)eZdZd„Zd„Zd„ZRS(sWRun the command twice each time and verify a backup file is *not* created. cCs/|jdƒ|jdƒ|jdtƒdS(Ns!cheetah compile --nobackup a.tmplsa.py(RsRSt BACKUP_SUFFIX(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRys  cCs/|jdƒ|jdƒ|jdtƒdS(Nscheetah fill --nobackup a.tmplsa.html(RsRSR(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRz s  cCs/|jdƒ|jdƒ|jdtƒdS(Ns)cheetah fill --nobackup --oext txt a.tmplsa.txt(RsRSR(R((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR{s  (RRRtRyRzR{(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyRŒs  cCsrtjdƒ}t|ƒ}xFtrc|jƒ}|s:Pn|j|ƒ}|r|jdƒGHqqW|jƒdS(sscheetahWrapperFile, string, path of this script. XXX TODO: don't print test where expectError is true. sself\.go\("(.*?)"\)iN(tretcompileR2RtreadlinetsearchtgroupR3(tcheetahWrapperFiletrxR8tlintm((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyt listTestss   cCs8tƒ}|jdddddƒ|jdddƒ|jdddƒ|jd d ddƒ|jd d ddƒ|jd dddƒ|jƒ\}}|jr®tan|jrÀtan|j rÙt |j ƒn[t j d3x4dD],}t ||ƒrêt j j d|ƒqêqêWt j j|ƒtjƒdS(Ns--listtactiontstoretdestR—s --nodeletet store_trues--outputs-es --explains-vs --verboses-qs--quietitexplainRtquiets--(sexplainsverbosesquiet(Rt add_optiont parse_argstnodeleteRMR:RaRtOUTPUTR—Rtargvtgetattrtappendtextendtunittesttmain(tparsertoptstfilestopt((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyR§%s(        t__main__(1RtR%tos.pathtpdbRŽR;RR)R¦toptparseRtCheetah.CheetahWrapperRt subprocessRRRRt ImportErrortpopen2RR:RMR¡RRtTestCaseRRvRxR|R}R~RR€RRƒR„R…R†R‡RˆR‰RŠR‹RŒR—R§R(((sI/opt/freeware/lib/python2.7/site-packages/Cheetah/Tests/CheetahWrapper.pyt sT           ´