diff options
Diffstat (limited to 'Lib/distutils/tests/test_archive_util.py')
-rw-r--r-- | Lib/distutils/tests/test_archive_util.py | 17 |
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 71d32dc..682f19a 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 @@ -262,6 +263,20 @@ class ArchiveUtilTestCase(support.TempdirManager, finally: archive.close() + 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) |