Ñò 9ÝoLc @ s( d d k Z d d k Z d d k Z d d k Z e i d e i d Z Z e e f Z d „ Z d e f d „ ƒ YZ d e f d „ ƒ YZ d e i f d „ ƒ YZ d e i f d „ ƒ YZ d e i f d „ ƒ YZ d e i f d „ ƒ YZ d e i f d „ ƒ YZ e d j o e i ƒ n d S( iÿÿÿÿNi i c C s t d j o t d j S( sJ Python 2.3 is still supported by Cheetah, but doesn't support decorators i i ( t majorVert minorVer( ( ( s? /usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyt isPython23 s t GetAttrExceptionc B s e Z RS( ( t __name__t __module__( ( ( s? /usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyR s t CustomGetAttrClassc B s e Z d „ Z RS( c C s t d | ƒ ‚ d S( Ns FAIL, %s( R ( t selft name( ( s? /usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyt __getattr__ s ( R R R ( ( ( s? /usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyR s t GetAttrTestc B s e Z d Z d „ Z d „ Z RS( sŠ Test for an issue occurring when __getatttr__() raises an exception causing NameMapper to raise a NotFound exception c C sV t ƒ } y | i GHWn- t j o } d S| i d | ƒ n X| i d ƒ d S( Ns Invalid exception raised: %ss# Should have had an exception raised( R t attrR t fail( R t ot e( ( s? /usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyt test_ValidException s c C sk d } t i i i | d h d t ƒ} | d h t ƒ d 6g ƒ } | p t d ‚ | i t | i ƒ d S( NsJ #def raiseme() $obj.attr #end deft compilerSettingst keepRefToGeneratedCodet searchListt objs- We should have a valid template object by now( t Cheetaht Templatet compilet TrueR t AssertionErrort failUnlessRaisesR t raiseme( R t template( ( s? /usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyt test_NotFoundException' s !( R R t __doc__R R ( ( ( s? /usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyR s t InlineImportTestc B s5 e Z d „ Z d „ Z d „ Z d „ Z d „ Z RS( c C s~ d } t i i i | d h t d 6d t ƒ} | d h g ƒ } | p t d ‚ | i ƒ } | d j p t | d f ‚ 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 R t useLegacyImportModeR R s- We should have a valid template object by nowi s Didn't get a proper return valueN( R R R t FalseR R t myfunction( R R t rc( ( s? /usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyt test_FromFooImportThing5 s (c C sl d } t i i i | d h t d 6d t ƒ} | d h g ƒ } | p t d ‚ t | ƒ p t d ‚ d S( Ns¿ #try #import invalidmodule #except #set invalidmodule = dict(FOO='BAR!') #end try $invalidmodule.FOO R R R R s- We should have a valid template object by nowsA We weren't able to properly generate the result from the template( R R R R R R t str( R R ( ( s? /usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyt test_ImportFailModuleM s (c C s9 d } | i t t i i i | d h t d 6d t ƒd S( Nsf #from invalid import fail This should totally $fail R R R ( R t ImportErrorR R R R R ( R R ( ( s? /usr/lib64/python2.6/site-packages/Cheetah/Tests/Regressions.pyt test_ProperImportOfBadModule] s c C s&