diff options
author | Brett Cannon <bcannon@gmail.com> | 2009-01-27 01:41:57 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2009-01-27 01:41:57 (GMT) |
commit | 1d0b43d24e6d3e65c33c97fd0ef877ba172d446c (patch) | |
tree | 1406c4092d61e947d71037d9762a4198c41d7ddb /Lib/importlib | |
parent | 97c8a07f1d927c218e65bcdfe107e5a306b12a76 (diff) | |
download | cpython-1d0b43d24e6d3e65c33c97fd0ef877ba172d446c.zip cpython-1d0b43d24e6d3e65c33c97fd0ef877ba172d446c.tar.gz cpython-1d0b43d24e6d3e65c33c97fd0ef877ba172d446c.tar.bz2 |
Move importlib.test.builtin.test_finder over to importlib.test.finder_tests.
Diffstat (limited to 'Lib/importlib')
-rw-r--r-- | Lib/importlib/test/builtin/test_finder.py | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/Lib/importlib/test/builtin/test_finder.py b/Lib/importlib/test/builtin/test_finder.py index 7d7ff36..5849b5e 100644 --- a/Lib/importlib/test/builtin/test_finder.py +++ b/Lib/importlib/test/builtin/test_finder.py @@ -1,29 +1,48 @@ from importlib import machinery +from .. import finder_tests from .. import support import sys import unittest -class FinderTests(unittest.TestCase): +class FinderTests(finder_tests.FinderTests): """Test find_module() for built-in modules.""" assert 'errno' in sys.builtin_module_names name = 'errno' - find_module = staticmethod(lambda name, path=None: - machinery.BuiltinImporter.find_module(name, path)) - - - def test_find_module(self): + def test_module(self): # Common case. with support.uncache(self.name): - self.assert_(self.find_module(self.name)) + self.assert_(machinery.BuiltinImporter.find_module(self.name)) + + def test_package(self): + # Built-in modules cannot be a package. + pass + + def test_module_in_package(self): + # Built-in modules cannobt be in a package. + pass + + def test_package_in_package(self): + # Built-in modules cannot be a package. + pass + + def test_package_over_module(self): + # Built-in modules cannot be a package. + pass + + def test_failure(self): + assert 'importlib' not in sys.builtin_module_names + loader = machinery.BuiltinImporter.find_module('importlib') + self.assert_(loader is None) def test_ignore_path(self): # The value for 'path' should always trigger a failed import. with support.uncache(self.name): - self.assert_(self.find_module(self.name, ['pkg']) is None) + loader = machinery.BuiltinImporter.find_module(self.name, ['pkg']) + self.assert_(loader is None) |