003 File Manager
Current Path:
/usr/local/lib/python3.8/test/test_importlib/extension
usr
/
local
/
lib
/
python3.8
/
test
/
test_importlib
/
extension
/
📁
..
📄
__init__.py
(142 B)
📄
__main__.py
(58 B)
📁
__pycache__
📄
test_case_sensitivity.py
(1.54 KB)
📄
test_finder.py
(1.24 KB)
📄
test_loader.py
(11.62 KB)
📄
test_path_hook.py
(864 B)
Editing: test_path_hook.py
from .. import util machinery = util.import_importlib('importlib.machinery') import unittest class PathHookTests: """Test the path hook for extension modules.""" # XXX Should it only succeed for pre-existing directories? # XXX Should it only work for directories containing an extension module? def hook(self, entry): return self.machinery.FileFinder.path_hook( (self.machinery.ExtensionFileLoader, self.machinery.EXTENSION_SUFFIXES))(entry) def test_success(self): # Path hook should handle a directory where a known extension module # exists. self.assertTrue(hasattr(self.hook(util.EXTENSIONS.path), 'find_module')) (Frozen_PathHooksTests, Source_PathHooksTests ) = util.test_both(PathHookTests, machinery=machinery) if __name__ == '__main__': unittest.main()
Upload File
Create Folder