summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_shutil.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-11-27 22:49:50 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-11-27 22:49:50 (GMT)
commit0a99b2ab61e506da60d9c48e440412a75399d4d0 (patch)
tree96f7658f0a648f664695e7b9ea2295a7c7e36a7d /Lib/test/test_shutil.py
parentf1fc9fb33d6e3181fde24d9fc1a5a224fda5c2ef (diff)
parent9a4fc19589a080d8e21ade8d64034b78d500b004 (diff)
downloadcpython-0a99b2ab61e506da60d9c48e440412a75399d4d0.zip
cpython-0a99b2ab61e506da60d9c48e440412a75399d4d0.tar.gz
cpython-0a99b2ab61e506da60d9c48e440412a75399d4d0.tar.bz2
Issue #21280: Fixed a bug in shutil.make_archive() when create an archive of
current directory in current directory.
Diffstat (limited to 'Lib/test/test_shutil.py')
-rw-r--r--Lib/test/test_shutil.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
index 96cb54b..b1f5bbe 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -1132,6 +1132,21 @@ class TestShutil(unittest.TestCase):
finally:
unregister_archive_format('xxx')
+ def test_make_tarfile_in_curdir(self):
+ # Issue #21280
+ root_dir = self.mkdtemp()
+ with support.change_cwd(root_dir):
+ self.assertEqual(make_archive('test', 'tar'), 'test.tar')
+ self.assertTrue(os.path.isfile('test.tar'))
+
+ @requires_zlib
+ def test_make_zipfile_in_curdir(self):
+ # Issue #21280
+ root_dir = self.mkdtemp()
+ with support.change_cwd(root_dir):
+ self.assertEqual(make_archive('test', 'zip'), 'test.zip')
+ self.assertTrue(os.path.isfile('test.zip'))
+
def test_register_archive_format(self):
self.assertRaises(TypeError, register_archive_format, 'xxx', 1)