summaryrefslogtreecommitdiff
path: root/Lib/distutils/tests/test_archive_util.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-10-24 13:42:10 +0000
committerTarek Ziadé <ziade.tarek@gmail.com>2009-10-24 13:42:10 +0000
commit53fdb18b822395cae6e085f85ccc59f07a38dfd6 (patch)
tree738e9df2ce820f9753d2df613a8bb4de3d2820bd /Lib/distutils/tests/test_archive_util.py
parentf6779fb1a4420775c1a32ac5ef396d061996be01 (diff)
downloadcpython-git-53fdb18b822395cae6e085f85ccc59f07a38dfd6.tar.gz
Merged revisions 75662 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r75662 | tarek.ziade | 2009-10-24 15:38:27 +0200 (Sat, 24 Oct 2009) | 9 lines Merged revisions 75659 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r75659 | tarek.ziade | 2009-10-24 15:29:44 +0200 (Sat, 24 Oct 2009) | 1 line #7066 - Fixed distutils.archive_util.make_archive behavior so it restores the cwd ........ ................
Diffstat (limited to 'Lib/distutils/tests/test_archive_util.py')
-rw-r--r--Lib/distutils/tests/test_archive_util.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/Lib/distutils/tests/test_archive_util.py b/Lib/distutils/tests/test_archive_util.py
index d88e0b350d..c6e08cbc2b 100644
--- a/Lib/distutils/tests/test_archive_util.py
+++ b/Lib/distutils/tests/test_archive_util.py
@@ -8,7 +8,8 @@ from os.path import splitdrive
import warnings
from distutils.archive_util import (check_archive_formats, make_tarball,
- make_zipfile, make_archive)
+ make_zipfile, make_archive,
+ ARCHIVE_FORMATS)
from distutils.spawn import find_executable, spawn
from distutils.tests import support
from test.support import check_warnings
@@ -192,6 +193,20 @@ class ArchiveUtilTestCase(support.TempdirManager,
base_name = os.path.join(tmpdir, 'archive')
self.assertRaises(ValueError, make_archive, base_name, 'xxx')
+ def test_make_archive_cwd(self):
+ current_dir = os.getcwd()
+ def _breaks(*args, **kw):
+ raise RuntimeError()
+ ARCHIVE_FORMATS['xxx'] = (_breaks, [], 'xxx file')
+ try:
+ try:
+ make_archive('xxx', 'xxx', root_dir=self.mkdtemp())
+ except:
+ pass
+ self.assertEquals(os.getcwd(), current_dir)
+ finally:
+ del ARCHIVE_FORMATS['xxx']
+
def test_suite():
return unittest.makeSuite(ArchiveUtilTestCase)