Cheps.py (cheetah3-3.2.2) | : | Cheps.py (cheetah3-3.2.3) | ||
---|---|---|---|---|
#!/usr/bin/env python | # import unittest | |||
import unittest | ||||
import Cheetah | import Cheetah | |||
import Cheetah.Parser | import Cheetah.Parser | |||
import Cheetah.Template | import Cheetah.Template | |||
class Chep_2_Conditionalized_Import_Behavior(unittest.TestCase): | # class Chep_2_Conditionalized_Import_Behavior(unittest.TestCase): | |||
class Chep_2_Conditionalized_Import_Behavior(): | ||||
def test_ModuleLevelImport(self): | def test_ModuleLevelImport(self): | |||
''' Verify module level (traditional) import behavior ''' | ''' Verify module level (traditional) import behavior ''' | |||
pass | pass | |||
def test_InlineImport(self): | def test_InlineImport(self): | |||
''' Verify (new) inline import behavior works ''' | ''' Verify (new) inline import behavior works ''' | |||
template = ''' | template = ''' | |||
#def funky($s) | #def funky($s) | |||
#try | #try | |||
#import urllib | #import urllib | |||
skipping to change at line 37 | skipping to change at line 36 | |||
template = Cheetah.Template.Template.compile(template) | template = Cheetah.Template.Template.compile(template) | |||
except Cheetah.Parser.ParseError as ex: | except Cheetah.Parser.ParseError as ex: | |||
self.fail('Failed to properly generate code %s' % ex) | self.fail('Failed to properly generate code %s' % ex) | |||
template = template() | template = template() | |||
rc = template.funky('abc def') | rc = template.funky('abc def') | |||
assert rc == 'abc+def' | assert rc == 'abc+def' | |||
def test_LegacyMode(self): | def test_LegacyMode(self): | |||
''' Verify disabling of CHEP #2 works ''' | ''' Verify disabling of CHEP #2 works ''' | |||
pass | pass | |||
if __name__ == '__main__': | ||||
unittest.main() | ||||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 3 lines changed or added |