diff options
Diffstat (limited to 'Lib/test/test_zipapp.py')
| -rw-r--r-- | Lib/test/test_zipapp.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_zipapp.py b/Lib/test/test_zipapp.py index 56cf37c..3602b99 100644 --- a/Lib/test/test_zipapp.py +++ b/Lib/test/test_zipapp.py @@ -100,6 +100,20 @@ class ZipAppTest(unittest.TestCase): expected_target = self.tmpdir / 'source.pyz' self.assertTrue(expected_target.is_file()) + def test_create_archive_with_compression(self): + # Test packing a directory into a compressed archive. + source = self.tmpdir / 'source' + source.mkdir() + (source / '__main__.py').touch() + (source / 'test.py').touch() + target = self.tmpdir / 'source.pyz' + + zipapp.create_archive(source, target, compressed=True) + with zipfile.ZipFile(target, 'r') as z: + for name in ('__main__.py', 'test.py'): + self.assertEqual(z.getinfo(name).compress_type, + zipfile.ZIP_DEFLATED) + def test_no_main(self): # Test that packing a directory with no __main__.py fails. source = self.tmpdir / 'source' |
