Ñò 9ÝoLc@s(ddkZddkZddkZddkZeideidZZeefZd„Z de fd„ƒYZ de fd„ƒYZ d eifd „ƒYZd eifd „ƒYZd eifd„ƒYZdeifd„ƒYZdeifd„ƒYZedjoeiƒndS(iÿÿÿÿNiicCstdjo tdjS(sJ Python 2.3 is still supported by Cheetah, but doesn't support decorators ii(tmajorVertminorVer(((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyt isPython23 stGetAttrExceptioncBseZRS((t__name__t __module__(((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyRstCustomGetAttrClasscBseZd„ZRS(cCstd|ƒ‚dS(NsFAIL, %s(R(tselftname((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyt __getattr__s(RRR (((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyRst GetAttrTestcBs eZdZd„Zd„ZRS(sŠ Test for an issue occurring when __getatttr__() raises an exception causing NameMapper to raise a NotFound exception cCsVtƒ}y |iGHWn-tj o }dS|id|ƒnX|idƒdS(NsInvalid exception raised: %ss#Should have had an exception raised(RtattrRtfail(Rtote((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyttest_ValidExceptions  cCskd}tiii|dhdtƒ}|dhtƒd6gƒ}|p td‚|it|iƒdS(NsJ #def raiseme() $obj.attr #end deftcompilerSettingstkeepRefToGeneratedCodet searchListtobjs-We should have a valid template object by now( tCheetahtTemplatetcompiletTrueRtAssertionErrortfailUnlessRaisesRtraiseme(Rttemplate((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyttest_NotFoundException's !(RRt__doc__RR(((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyR s tInlineImportTestcBs5eZd„Zd„Zd„Zd„Zd„ZRS(cCs~d}tiii|dhtd6dtƒ}|dhgƒ}|p td‚|iƒ}|djpt|df‚d S( sÔ Verify that a bug introduced in v2.1.0 where an inline: #from module import class would result in the following code being generated: import class sÐ #def myfunction() #if True #from os import path #return 17 Hello! #end if #end def RtuseLegacyImportModeRRs-We should have a valid template object by nowis Didn't get a proper return valueN(RRRtFalseRRt myfunction(RRtrc((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyttest_FromFooImportThing5s ( cCsld}tiii|dhtd6dtƒ}|dhgƒ}|p td‚t|ƒp td‚dS(Ns¿ #try #import invalidmodule #except #set invalidmodule = dict(FOO='BAR!') #end try $invalidmodule.FOO RRRRs-We should have a valid template object by nowsAWe weren't able to properly generate the result from the template(RRRR RRtstr(RR((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyttest_ImportFailModuleMs (cCs9d}|ittiii|dhtd6dtƒdS(Nsf #from invalid import fail This should totally $fail RRR(Rt ImportErrorRRRR R(RR((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyttest_ProperImportOfBadModule]scCs&d}|ittiii|ƒdS(Ns> #extends FakeyTemplate Boo! (RR&RRR(RR((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyttest_AutoImportingescCs9d}|ittiii|dhtd6dtƒdS(Ns< ### ### I like comments before import ### #extends Foo Bar RRR(RR&RRRR(RR((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyttest_StuffBeforeImport_Legacyms(RRR#R%R'R(R)(((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyR4s     tMantis_Issue_11_Regression_TestcBs eZdZd„Zd„ZRS(s— Test case for bug outlined in Mantis issue #11: Output: Traceback (most recent call last): File "test.py", line 12, in t.respond() File "DynamicallyCompiledCheetahTemplate.py", line 86, in respond File "/usr/lib64/python2.6/cgi.py", line 1035, in escape s = s.replace("&", "&") # Must be done first! cCs]ddk}tiiddh|id6dd6gƒ}|pt‚|it|iƒdS(Niÿÿÿÿs$escape($request)Rtescapetfoobartrequest(tcgiRRR+RRtAttributeErrortrespond(RR.R((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyttest_FailingBehavior„s ,c Cskddk}tiiddh|id6dd6gdhtd6ƒ}|pt‚|iƒpt‚dS( Niÿÿÿÿs$escape($request)RR+R,R-RtprioritizeSearchListOverSelf(R.RRR+RRR0(RR.R((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyttest_FailingBehaviorWithSetting‹s  (RRRR1R3(((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyR*xs  tMantis_Issue_21_Regression_TestcBseZdZd„ZRS(sò Test case for bug outlined in issue #21 Effectively @staticmethod and @classmethod decorated methods in templates don't properly define the _filter local, which breaks when using the NameMapper cCsVtƒodSd}tiii|ƒ}|pt‚|iddƒpt‚dS(Nsz #@staticmethod #def testMethod() This is my $output #end def toutputtbug(RRRRRt testMethod(RR((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pytrunTestœs  (RRRR8(((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyR4“stMantis_Issue_22_Regression_TestcBs eZdZd„Zd„ZRS(s Test case for bug outlined in issue #22 When using @staticmethod and @classmethod in conjunction with the #filter directive the generated code for the #filter is reliant on the `self` local, breaking the function cCsZdStƒodSd}tiii|ƒ}|pt‚|iddƒpt‚dS(Ns· #@staticmethod #def testMethod() #filter None This is my $output #end filter #end def R5R6(RRRRRR7(RR((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyttest_NoneFilter³s cCsZdStƒodSd}tiii|ƒ}|pt‚|iddƒpt‚dS(Ns¹ #@staticmethod #def testMethod() #filter Filter This is my $output #end filter #end def R5R6(RRRRRR7(RR((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyttest_DefinedFilterÄs  (RRRR:R;(((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyR9ªs t__main__(tCheetah.NameMapperRtCheetah.Templatetsystunittestt version_infoRRt versionTupleRt ExceptionRtobjectRtTestCaseR RR*R4R9Rtmain(((s?/usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyts      DK