/var/opt/nydus/ops/importlib_resources/tests
NameSizeModeActions
compat/-0755rm
__pycache__/-0755rm
test_compatibilty_files.py33130644editdlrm
test_contents.py8380644editdlrm
test_custom.py12220644editdlrm
test_files.py57410644editdlrm
test_functional.py90700644editdlrm
test_open.py26820644editdlrm
test_path.py19860644editdlrm
test_read.py30460644editdlrm
test_reader.py46550644editdlrm
test_resource.py76870644editdlrm
test_util.py11050644editdlrm
util.py98040644editdlrm
zip.py5770644editdlrm
_path.py22500644editdlrm
__init__.py00644editdlrm
Edit: /var/opt/nydus/ops/importlib_resources/tests/zip.py (577B)
""" Generate zip test data files. """ import zipfile import zipp def make_zip_file(tree, dst): """ Zip the files in tree into a new zipfile at dst. """ with zipfile.ZipFile(dst, 'w') as zf: for name, contents in walk(tree): zf.writestr(name, contents) zipp.CompleteDirs.inject(zf) return dst def walk(tree, prefix=''): for name, contents in tree.items(): if isinstance(contents, dict): yield from walk(contents, prefix=f'{prefix}{name}/') else: yield f'{prefix}{name}', contents