MCPcopy Index your code
hub / github.com/python/cpython / test_create_archive_with_compression

Method test_create_archive_with_compression

Lib/test/test_zipapp.py:159–171  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

157
158 @requires_zlib()
159 def test_create_archive_with_compression(self):
160 # Test packing a directory into a compressed archive.
161 source = self.tmpdir / 'source'
162 source.mkdir()
163 (source / '__main__.py').touch()
164 (source / 'test.py').touch()
165 target = self.tmpdir / 'source.pyz'
166
167 zipapp.create_archive(source, target, compressed=True)
168 with zipfile.ZipFile(target, 'r') as z:
169 for name in ('__main__.py', 'test.py'):
170 self.assertEqual(z.getinfo(name).compress_type,
171 zipfile.ZIP_DEFLATED)
172
173 def test_no_main(self):
174 # Test that packing a directory with no __main__.py fails.

Callers

nothing calls this directly

Calls 4

mkdirMethod · 0.45
touchMethod · 0.45
assertEqualMethod · 0.45
getinfoMethod · 0.45

Tested by

no test coverage detected