"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Cheetah/Tests/Template.py" between
cheetah3-3.1.0.tar.gz and cheetah3-3.2.0.tar.gz

About: Cheetah3 is a template engine and code generation tool for e.g. for Web development or Java, SQL, LaTeX, form email ... (written in Python).

Template.py  (cheetah3-3.1.0):Template.py  (cheetah3-3.2.0)
skipping to change at line 255 skipping to change at line 255
def test_i18n(self): def test_i18n(self):
src = '''\ src = '''\
%i18n: This is a $string that needs translation %i18n: This is a $string that needs translation
%i18n id="foo", domain="root": This is a $string that needs translation %i18n id="foo", domain="root": This is a $string that needs translation
''' '''
src = '\n'.join([ln.strip() for ln in src.splitlines()]) src = '\n'.join([ln.strip() for ln in src.splitlines()])
klass = Template.compile(src, preprocessors='@ %', baseclass=dict) klass = Template.compile(src, preprocessors='@ %', baseclass=dict)
t = klass({'string': 'bit of text'}) t = klass({'string': 'bit of text'})
# print str(t), repr(str(t)) # print str(t), repr(str(t))
assert str(t) == ( assert str(t) == (
'This is a bit of text that needs translation\n'*2)[:-1] 'This is a bit of text that needs translation\n'*2)[:-1] # noqa: E2 26,E501 missing whitespace around operator
class TryExceptImportTest(TemplateTest): class TryExceptImportTest(TemplateTest):
def test_FailCase(self): def test_FailCase(self):
""" """
Test situation where an inline #import statement will get relocated Test situation where an inline #import statement will get relocated
""" """
source = ''' source = '''
#def myFunction() #def myFunction()
Ahoy! Ahoy!
#try #try
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)