"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Cheetah/Tests/LoadTemplate.py" between
cheetah3-3.2.2.tar.gz and cheetah3-3.2.3.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).

LoadTemplate.py  (cheetah3-3.2.2):LoadTemplate.py  (cheetah3-3.2.3)
#!/usr/bin/env python
import os import os
import unittest import unittest
import Cheetah.ImportHooks import Cheetah.ImportHooks
from Cheetah.LoadTemplate import loadTemplateClass from Cheetah.LoadTemplate import loadTemplateClass
from Cheetah.Tests.ImportHooks import ImportHooksTemplatesDir, _cleanup from Cheetah.Tests.ImportHooks import ImportHooksTemplatesDir, _cleanup
from Cheetah.Tests.ImportHooks import setUpModule, tearDownModule # noqa from Cheetah.Tests.ImportHooks import setUpModule, tearDownModule # noqa
class LoadTemplateTest(unittest.TestCase): class LoadTemplateTest(unittest.TestCase):
def setUp(self): def setUp(self):
_cleanup() _cleanup()
def tearDown(self):
_cleanup()
def test_loadTemplate(self): def test_loadTemplate(self):
templates = os.listdir(ImportHooksTemplatesDir) templates = os.listdir(ImportHooksTemplatesDir)
self.assertNotIn('index.py', templates) self.assertNotIn('index.py', templates)
self.assertNotIn('layout.py', templates) self.assertNotIn('layout.py', templates)
self.assertRaises(ImportError, loadTemplateClass, self.assertRaises(ImportError, loadTemplateClass,
os.path.join(ImportHooksTemplatesDir, 'index.tmpl')) os.path.join(ImportHooksTemplatesDir, 'index.tmpl'))
templates = os.listdir(ImportHooksTemplatesDir) templates = os.listdir(ImportHooksTemplatesDir)
self.assertIn('index.py', templates) self.assertIn('index.py', templates)
skipping to change at line 50 skipping to change at line 51
self.assertNotIn('index.py', templates) self.assertNotIn('index.py', templates)
self.assertNotIn('layout.py', templates) self.assertNotIn('layout.py', templates)
Cheetah.ImportHooks.install() Cheetah.ImportHooks.install()
loadTemplateClass( loadTemplateClass(
os.path.join(ImportHooksTemplatesDir, 'index.tmpl')) os.path.join(ImportHooksTemplatesDir, 'index.tmpl'))
templates = os.listdir(ImportHooksTemplatesDir) templates = os.listdir(ImportHooksTemplatesDir)
self.assertIn('index.py', templates) self.assertIn('index.py', templates)
self.assertIn('layout.py', templates) self.assertIn('layout.py', templates)
Cheetah.ImportHooks.uninstall() Cheetah.ImportHooks.uninstall()
if __name__ == '__main__':
unittest.main()
 End of changes. 3 change blocks. 
2 lines changed or deleted 3 lines changed or added

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