MCPcopy
hub / github.com/pex-tool/pex / test_perm_preserving_zipfile_extract

Function test_perm_preserving_zipfile_extract

tests/test_common.py:115–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113
114
115def test_perm_preserving_zipfile_extract():
116 # type: () -> None
117 with zip_fixture() as (zip_file, extract_dir):
118 with contextlib.closing(ZipFileEx(zip_file)) as zf:
119 zf.extract("no-x", path=extract_dir)
120 zf.extract("no-w", path=extract_dir)
121 zf.extract("with-x", path=extract_dir)
122
123 no_x = os.path.join(extract_dir, "no-x")
124 no_w = os.path.join(extract_dir, "no-w")
125 with_x = os.path.join(extract_dir, "with-x")
126
127 assert not is_executable(no_x)
128 assert not is_executable(no_w)
129 assert is_executable(with_x)
130
131 files = [no_x, no_w, with_x]
132 assert all(is_writeable(f) for f in files)
133
134
135def assert_chroot_perms(copyfn):

Callers

nothing calls this directly

Calls 6

ZipFileExClass · 0.90
zip_fixtureFunction · 0.85
is_executableFunction · 0.85
is_writeableFunction · 0.85
extractMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected