diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2018-12-05 21:46:25 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-05 21:46:25 +0200 |
| commit | 15789c14939f1c441c95963419e1b3f941a2831d (patch) | |
| tree | d11762a0e7e4d28652b651d6c4152bb2837c4560 /tests/test_archive_util.py | |
| parent | b841e0aececb0e28ff3fabe29bf22c4b86fae9d8 (diff) | |
| download | python-setuptools-git-15789c14939f1c441c95963419e1b3f941a2831d.tar.gz | |
bpo-34738: Add directory entries in ZIP files created by distutils. (GH-9419)
Diffstat (limited to 'tests/test_archive_util.py')
| -rw-r--r-- | tests/test_archive_util.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/test_archive_util.py b/tests/test_archive_util.py index 14ba4ca3..e9aad0e4 100644 --- a/tests/test_archive_util.py +++ b/tests/test_archive_util.py @@ -122,12 +122,13 @@ class ArchiveUtilTestCase(support.TempdirManager, try: names = tar.getnames() names.sort() - return tuple(names) + return names finally: tar.close() - _created_files = ('dist', 'dist/file1', 'dist/file2', - 'dist/sub', 'dist/sub/file3', 'dist/sub2') + _zip_created_files = ['dist/', 'dist/file1', 'dist/file2', + 'dist/sub/', 'dist/sub/file3', 'dist/sub2/'] + _created_files = [p.rstrip('/') for p in _zip_created_files] def _create_files(self): # creating something to tar @@ -244,8 +245,7 @@ class ArchiveUtilTestCase(support.TempdirManager, tarball = base_name + '.zip' self.assertTrue(os.path.exists(tarball)) with zipfile.ZipFile(tarball) as zf: - self.assertEqual(sorted(zf.namelist()), - ['dist/file1', 'dist/file2', 'dist/sub/file3']) + self.assertEqual(sorted(zf.namelist()), self._zip_created_files) @unittest.skipUnless(ZIP_SUPPORT, 'Need zip support to run') def test_make_zipfile_no_zlib(self): @@ -271,8 +271,7 @@ class ArchiveUtilTestCase(support.TempdirManager, [((tarball, "w"), {'compression': zipfile.ZIP_STORED})]) self.assertTrue(os.path.exists(tarball)) with zipfile.ZipFile(tarball) as zf: - self.assertEqual(sorted(zf.namelist()), - ['dist/file1', 'dist/file2', 'dist/sub/file3']) + self.assertEqual(sorted(zf.namelist()), self._zip_created_files) def test_check_archive_formats(self): self.assertEqual(check_archive_formats(['gztar', 'xxx', 'zip']), |
