PATH: //proc/self/root/opt/alt/python311/lib64/python3.11/test/test_importlib/extension
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 __init__.py
↓
X
📄 __main__.py
↓
X
📁 __pycache__/
X
📄 test_case_sensitivity.py
↓
X
📄 test_finder.py
↓
X
📄 test_loader.py
↓
X
📄 test_path_hook.py
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: test_path_hook.py
from test.test_importlib import util machinery = util.import_importlib('importlib.machinery') import unittest @unittest.skipIf(util.EXTENSIONS is None or util.EXTENSIONS.filename is None, 'dynamic loading not supported or test module not available') 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()
SIMPAN PERUBAHAN