Ñò 9ÝoLc @sddkZddkZddkZddkZddkZddkZddkZddkZddkl Z ei dei dZ Z e e fZ deifd„ƒYZdefd„ƒYZd efd „ƒYZd efd „ƒYZd efd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZedjoeiƒndS(iÿÿÿÿN(tTemplateiit TemplateTestcBseZRS((t__name__t __module__(((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyRstClassMethods_compilecBs_eZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z RS( s‚I am using the same Cheetah source for each test to root out clashes caused by the compile caching in Template.compile(). cCs,tiddƒ}|dhdd6ƒ}dS(Ntsources$foot namespacesiÒtfoo(Rtcompile(tselftklasstt((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyttest_basicUsagescCs°tidddtƒ}|hdd6ƒ}tiddd|ƒ}|hdd6ƒ}tiddd|ƒ}|hdd6ƒ}tiddddƒ}|hdd6ƒ}dS(NRs$foot baseclassiÒRs#implements dummy $bartdict(RRR(R R R tklass2tklass3tklass4((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyttest_baseclassArgsc CshtdjodStiƒ}z2tidddtd|ƒ}ti|i}Wdt i |tƒXdS(NiiRs$footcacheModuleFilesForTracebackstcacheDirForModuleFiles(ii( t versionTuplettempfiletmkdtempRRtTruetsystmodulesRtshutiltrmtree(R ttmpDirR tmod((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyttest_moduleFileCaching-s   cCs2tiddddƒ}|dhdd6ƒ}dS(NRs$foot classNametfoo123RiÒR(RR(R R R ((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyttest_classNameArg>scCs€tiddddƒ}tid}|dhdd6ƒ}tiddddd d ƒ}tid}|dhdd6ƒ}dS( NRs$foot moduleNametfoo99RiÒRtfoo1R tfoo2(RRRR(R R RR ((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyttest_moduleNameArgDs   c Csutiddddddƒ}|dhdd 6ƒ}tiddd d ddddd tƒ}|hdd 6ƒ}dS( NRs$fooR R!tmainMethodNamettestMethRiÒRR#tfooXXXR (RRR(R R R ((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyttest_mainMethodNameArgUs  c Cs™tidddhdd6ƒ}|ƒ}tidddddhtd6ƒ}|hdd6ƒ}tidddddhtd6dd6ƒ}|ƒ}dS(NRs$foot moduleGlobalsiÒRR tTest1(RRR(R R R RR((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyttest_moduleGlobalsArgls  c Cs¦tidddddtdtƒ}|dhdd 6ƒ}tidddddtƒ}|dhdd 6ƒ}tidddddtƒ}|dhdd 6ƒ}dS( NRs$fooR tunique58tcacheCompilationResultstkeepRefToGeneratedCodeRiÒR(RRtFalseR(R R R RR((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyttest_keepRefToGeneratedCodeArg}s   cCsštidddddtƒ}|dhdd6ƒ}tidddddtƒ}|dhdd6ƒ}tidddd ƒ}|dhdd6ƒ}dS( NRs$fooR t unique111R0RiÒRt unique999099(RRR2R(R R R ((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyttest_compilationCache—s   ( RRt__doc__R RRR"R'R+R.R3R6(((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyRs        tClassMethods_subclasscBseZd„ZRS(cCsytidddtƒ}|hdd6ƒ}|iddƒ}|hdd6ƒ}|iddƒ}|hdd6ƒ}dS(NRs$fooR iÒRs#implements dummy $bar(RRRtsubclass(R R R RR((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyR ²s(RRR (((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyR8°st PreprocessorscBs,eZd„Zd„Zd„Zd„ZRS(cCspd}dig}|iƒD]}||iƒq~ƒ}hdd6hdd6d6}ti|d|ƒ}dS( Ns3 %set foo = @a $(@foo*10) @as s@ %ttokensictaRt preprocessors(tjoint splitlineststripRR(R tsrct_[1]tlnR=R ((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyttest_basicUsage1Âs 6 c Csód}ddd„ƒY}|ƒ}ddkl}ti|ƒ}||ƒ}d„}dtfd„ƒY}hd d 6d d 6d d6}xedhdd6h|d6h|d6hd6hdd6|d6|||gD]} ti|d| ƒ} qÐWdS(Ns"%set foo = 12 %%comment $(@foo*10)t Settings1cBseZdZRS(s@ %(RRR;(((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyREÑsiÿÿÿÿ(tTemplatePreprocessorcSsdS(Ns$(12*10)(s$(12*10)N(tNone(Rtfile((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyt preprocFuncØstTemplateSubclasscBseZRS((RR(((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyRJÛst@tcheetahVarStartTokent%tdirectiveStartTokens%%tcommentStartTokens@ %R;tcompilerSettingsttemplateInitArgsttemplateAPIClassR=((tCheetah.TemplateRFRt_normalizePreprocessorSettingsR( R RARERFtsettingst preprocObjRIRJRPtargR ((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyt%test_normalizePreprocessorArgVariantsÎs0         cCsŸd}dig}|iƒD]}||iƒq~ƒ}x\hdd6hdd6d6hdd6hdd6d6gD]$}ti|d|ƒ}|ƒ}qsWdS( Nsž %set foo = @a %def func1: #def func(arg): $arg("***") %% comment $(@foo*10) @func1 $func(lambda x:c"--$x--@a")s s@ %R;icR<RR=(R>R?R@RR(R RARBRCRWR R ((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyttest_complexUsageós6 cCsnd}dig}|iƒD]}||iƒq~ƒ}ti|dddtƒ}|hdd6ƒ}dS(Ns %i18n: This is a $string that needs translation %i18n id="foo", domain="root": This is a $string that needs translation s R=s@ %R s bit of texttstring(R>R?R@RRR(R RARBRCR R ((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyt test_i18ns 6(RRRDRXRYR[(((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyR:Às % tTryExceptImportTestcBseZd„ZRS(cCs?d}tid|dhtd6ƒ}|dhdd6ƒ}dS( sE Test situation where an inline #import statement will get relocated sý #def myFunction() Ahoy! #try #import sys #except ImportError $print "This will never happen!" #end try #end def RRPtuseLegacyImportModeRiÒRN(RRR2(R RR R ((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyt test_FailCases (RRR^(((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyR\stClassMethodSupportcBseZd„ZRS(cCs‰tiddjotiddjo dGHdSd}tid|ƒ}y|idd ƒ}Wn"tj o}|i|ƒnXdS( NiiiisAThis version of Python doesn't support decorators, skipping testss„ #@classmethod #def myClassMethod() #return '$foo = %s' % $foo #end def RRtbar(Rt version_infoRRt myClassMethodtAttributeErrortfail(R ttemplatetrctex((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyttest_BasicDecorator%s((RRRh(((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyR_$stStaticMethodSupportcBseZd„ZRS(cCs‰tiddjotiddjo dGHdSd}tid|ƒ}y|idd ƒ}Wn"tj o}|i|ƒnXdS( NiiiisAThis version of Python doesn't support decorators, skipping testss† #@staticmethod #def myStaticMethod() #return '$foo = %s' % $foo #end def RRR`(RRaRRtmyStaticMethodRcRd(R ReRfRg((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyRh7s((RRRh(((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyRi6stUselesscBseZd„ZRS(cCs dddgS(Niii((R ((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pytboinkIs(RRRl(((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyRkHstMultipleInheritanceSupportcBseZd„ZRS(cCsHd}ti|dhtd6dhtd6ƒ}|ƒ}|iƒ}dS(Ns… #extends Template, Useless #def foo() #return [4,5] + $boink() #end def R,RkRPtautoImportForExtendsDirective(RRRkR2R(R Retresult((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pytrunTestMs    (RRRp(((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyRmLst__main__(tpdbRttypestostos.pathRRtunittestRSRRatmajorVertminorVerRtTestCaseRRR8R:R\R_RitobjectRkRmRtmain(((s</usr/lib64/python2.6/site-packages/Cheetah/Tests/Template.pyts*         žS