PATH: //opt/alt/python311/lib64/python3.11/test/test_importlib
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 __init__.py
↓
X
📄 __main__.py
↓
X
📁 __pycache__/
X
📄 abc.py
↓
X
📁 builtin/
X
📁 data/
X
📁 data01/
X
📁 data02/
X
📁 data03/
X
📁 extension/
X
📄 fixtures.py
↓
X
📁 frozen/
X
📁 import_/
X
📁 namespace_pkgs/
X
📁 namespacedata01/
X
📁 partial/
X
📁 resources/
X
📁 source/
X
📄 stubs.py
↓
X
📄 test_abc.py
↓
X
📄 test_api.py
↓
X
📄 test_compatibilty_files.py
↓
X
📄 test_contents.py
↓
X
📄 test_files.py
↓
X
📄 test_lazy.py
↓
X
📄 test_locks.py
↓
X
📄 test_main.py
↓
X
📄 test_metadata_api.py
↓
X
📄 test_namespace_pkgs.py
↓
X
📄 test_open.py
↓
X
📄 test_path.py
↓
X
📄 test_pkg_import.py
↓
X
📄 test_read.py
↓
X
📄 test_reader.py
↓
X
📄 test_resource.py
↓
X
📄 test_spec.py
↓
X
📄 test_threaded_import.py
↓
X
📄 test_util.py
↓
X
📄 test_windows.py
↓
X
📄 test_zip.py
↓
X
📄 threaded_import_hangers.py
↓
X
📄 update-zips.py
↓
X
📄 util.py
↓
X
📁 zipdata01/
X
📁 zipdata02/
X
SAVING...
BERHASIL DIUBAH!
EDITING: update-zips.py
""" Generate the zip test data files. Run to build the tests/zipdataNN/ziptestdata.zip files from files in tests/dataNN. Replaces the file with the working copy, but does commit anything to the source repo. """ import contextlib import os import pathlib import zipfile def main(): """ >>> from unittest import mock >>> monkeypatch = getfixture('monkeypatch') >>> monkeypatch.setattr(zipfile, 'ZipFile', mock.MagicMock()) >>> print(); main() # print workaround for bpo-32509 <BLANKLINE> ...data01... -> ziptestdata/... ... ...data02... -> ziptestdata/... ... """ suffixes = '01', '02' tuple(map(generate, suffixes)) def generate(suffix): root = pathlib.Path(__file__).parent.relative_to(os.getcwd()) zfpath = root / f'zipdata{suffix}/ziptestdata.zip' with zipfile.ZipFile(zfpath, 'w') as zf: for src, rel in walk(root / f'data{suffix}'): dst = 'ziptestdata' / pathlib.PurePosixPath(rel.as_posix()) print(src, '->', dst) zf.write(src, dst) def walk(datapath): for dirpath, dirnames, filenames in os.walk(datapath): with contextlib.suppress(ValueError): dirnames.remove('__pycache__') for filename in filenames: res = pathlib.Path(dirpath) / filename rel = res.relative_to(datapath) yield res, rel __name__ == '__main__' and main()
SIMPAN PERUBAHAN