(self)
| 90 | self.assertNotIn('test.pyc', z.namelist()) |
| 91 | |
| 92 | def test_create_archive_self_insertion(self): |
| 93 | # When creating an archive, we shouldn't |
| 94 | # include the archive in the list of files to add. |
| 95 | source = self.tmpdir |
| 96 | (source / '__main__.py').touch() |
| 97 | (source / 'test.py').touch() |
| 98 | target = self.tmpdir / 'target.pyz' |
| 99 | |
| 100 | zipapp.create_archive(source, target) |
| 101 | with zipfile.ZipFile(target, 'r') as z: |
| 102 | self.assertEqual(len(z.namelist()), 2) |
| 103 | self.assertIn('__main__.py', z.namelist()) |
| 104 | self.assertIn('test.py', z.namelist()) |
| 105 | |
| 106 | def test_target_overwrites_source_file(self): |
| 107 | # The target cannot be one of the files to add. |
nothing calls this directly
no test coverage detected