summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_shutil.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-10-23 12:55:09 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-10-23 12:55:09 (GMT)
commit666de7772708047b63125126b0147931571254a4 (patch)
tree8ceb8d7dcc07c82d982072b5757e5405018ea980 /Lib/test/test_shutil.py
parent61c4c44b2a821740c78964398a3469ad10bd03ad (diff)
downloadcpython-666de7772708047b63125126b0147931571254a4.zip
cpython-666de7772708047b63125126b0147931571254a4.tar.gz
cpython-666de7772708047b63125126b0147931571254a4.tar.bz2
Issue #28488: shutil.make_archive() no longer adds entry "./" to ZIP archive.
Diffstat (limited to 'Lib/test/test_shutil.py')
-rw-r--r--Lib/test/test_shutil.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
index 1d5e01a..1e65a2a 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -1068,6 +1068,19 @@ class TestShutil(unittest.TestCase):
with support.change_cwd(work_dir):
base_name = os.path.abspath(rel_base_name)
+ res = make_archive(rel_base_name, 'zip', root_dir)
+
+ self.assertEqual(res, base_name + '.zip')
+ self.assertTrue(os.path.isfile(res))
+ self.assertTrue(zipfile.is_zipfile(res))
+ with zipfile.ZipFile(res) as zf:
+ self.assertCountEqual(zf.namelist(),
+ ['dist/', 'dist/sub/', 'dist/sub2/',
+ 'dist/file1', 'dist/file2', 'dist/sub/file3',
+ 'outer'])
+
+ with support.change_cwd(work_dir):
+ base_name = os.path.abspath(rel_base_name)
res = make_archive(rel_base_name, 'zip', root_dir, base_dir)
self.assertEqual(res, base_name + '.zip')