Added tests for old imports
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Armin Ronacher · committed by Armin Ronacher · parent 80bd694 · Browse files · 5 files·+32 added−5 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+32 added−5 removed
- other:+32 added−5 removed
Provenance
- Commit
f80bfca- Tree
6c1f2bc- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
80bd694
5 files changed+32 added−5 removed
added:flask/testsuite/test_apps/flaskext/oldext_package/__init__.py+1 added
1+ext_id = 'oldext_package'added:flask/testsuite/test_apps/flaskext/oldext_package/submodule.py+2 added
1+def test_function():2+ return 42added:flask/testsuite/test_apps/flaskext/__init__.py
added:flask/testsuite/test_apps/flaskext/oldext_simple.py+1 added
1+ext_id = 'oldext_simple'modified:flask/testsuite/ext.py+28 added-5 removed
29 unmodified lines30 cls.__name__ == '_ExtensionImporter':31 import_hooks += 132 self.assert_equal(import_hooks, 1)33 34- def test_flaskext_simple_import_normal(self):34+ def test_flaskext_new_simple_import_normal(self):35 from flask.ext.newext_simple import ext_id36 self.assert_equal(ext_id, 'newext_simple')37 38- def test_flaskext_simple_import_module(self):38+ def test_flaskext_new_simple_import_module(self):39 from flask.ext import newext_simple40 self.assert_equal(newext_simple.ext_id, 'newext_simple')41 self.assert_equal(newext_simple.__name__, 'flask_newext_simple')42 43- def test_flaskext_package_import_normal(self):43+ def test_flaskext_new_package_import_normal(self):44 from flask.ext.newext_package import ext_id45 self.assert_equal(ext_id, 'newext_package')46 47- def test_flaskext_package_import_module(self):47+ def test_flaskext_new_package_import_module(self):48 from flask.ext import newext_package49 self.assert_equal(newext_package.ext_id, 'newext_package')50 self.assert_equal(newext_package.__name__, 'flask_newext_package')51 52- def test_flaskext_package_import_submodule(self):52+ def test_flaskext_new_package_import_submodule(self):53 from flask.ext.newext_package import submodule54 self.assert_equal(submodule.__name__, 'flask_newext_package.submodule')55 self.assert_equal(submodule.test_function(), 42)56 57+ def test_flaskext_old_simple_import_normal(self):58+ from flask.ext.oldext_simple import ext_id59+ self.assert_equal(ext_id, 'oldext_simple')60 61+ def test_flaskext_old_simple_import_module(self):62+ from flask.ext import oldext_simple63+ self.assert_equal(oldext_simple.ext_id, 'oldext_simple')64+ self.assert_equal(oldext_simple.__name__, 'flaskext.oldext_simple')65+66+ def test_flaskext_old_package_import_normal(self):67+ from flask.ext.oldext_package import ext_id68+ self.assert_equal(ext_id, 'oldext_package')69+70+ def test_flaskext_old_package_import_module(self):71+ from flask.ext import oldext_package72+ self.assert_equal(oldext_package.ext_id, 'oldext_package')73+ self.assert_equal(oldext_package.__name__, 'flaskext.oldext_package')74+75+ def test_flaskext_old_package_import_submodule(self):76+ from flask.ext.oldext_package import submodule77+ self.assert_equal(submodule.__name__, 'flaskext.oldext_package.submodule')78+ self.assert_equal(submodule.test_function(), 42)79+80+81 def suite():82 suite = unittest.TestSuite()83 suite.addTest(unittest.makeSuite(ExtImportHookTestCase))84 return suite