"Fossies" - the Fresh Open Source Software Archive  

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

ImportHooks.py  (cheetah3-3.2.3):ImportHooks.py  (cheetah3-3.2.4)
from glob import glob from glob import glob
import os import os
import shutil import shutil
import sys import sys
import unittest import unittest
import Cheetah.ImportHooks import Cheetah.ImportHooks
from Cheetah.compat import PY2
ImportHooksTemplatesDir = os.path.join( ImportHooksTemplatesDir = os.path.join(
os.path.dirname(__file__), 'ImportHooksTemplates') os.path.dirname(__file__), 'ImportHooksTemplates')
def setUpModule(): def setUpModule():
sys.path.append(ImportHooksTemplatesDir) sys.path.append(ImportHooksTemplatesDir)
def tearDownModule(): def tearDownModule():
assert sys.path[-1] == ImportHooksTemplatesDir assert sys.path[-1] == ImportHooksTemplatesDir
del sys.path[-1] del sys.path[-1]
skipping to change at line 82 skipping to change at line 83
self.assertIn('index.py', templates) self.assertIn('index.py', templates)
self.assertIn('layout.py', templates) self.assertIn('layout.py', templates)
def test_import_builtin(self): def test_import_builtin(self):
Cheetah.ImportHooks.install() Cheetah.ImportHooks.install()
for nm in sys.builtin_module_names: for nm in sys.builtin_module_names:
if nm not in sys.modules: if nm not in sys.modules:
__import__(nm) __import__(nm)
return return
raise self.fail("All builtin modules are imported") raise self.fail("All builtin modules are imported")
if not PY2:
def test_import_bootlocale(self):
if '_bootlocale' in sys.modules:
del sys.modules['_bootlocale']
Cheetah.ImportHooks.install()
import _bootlocale # noqa: F401 '_bootlocale' imported but unused
 End of changes. 2 change blocks. 
0 lines changed or deleted 1 lines changed or added

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