diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2011-03-16 17:52:20 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2011-03-16 17:52:20 (GMT) |
commit | abf202d798fec4cbe90a46d3fdba761ef6be0b85 (patch) | |
tree | 4110c5c84b926cad729c01639bb42f07b72e8d2a /Lib/test/test_shutil.py | |
parent | a78e4e6daf0b5623ce71966ef32a275ebce708fc (diff) | |
download | cpython-abf202d798fec4cbe90a46d3fdba761ef6be0b85.zip cpython-abf202d798fec4cbe90a46d3fdba761ef6be0b85.tar.gz cpython-abf202d798fec4cbe90a46d3fdba761ef6be0b85.tar.bz2 |
Close #11548: Correctly handle format argument in shutil.unpack_archive
Diffstat (limited to 'Lib/test/test_shutil.py')
-rw-r--r-- | Lib/test/test_shutil.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index 30d9e07..8d003a8 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -645,6 +645,14 @@ class TestShutil(unittest.TestCase): diff = self._compare_dirs(tmpdir, tmpdir2) self.assertEqual(diff, []) + # and again, this time with the format specified + tmpdir3 = self.mkdtemp() + unpack_archive(filename, tmpdir3, format=format) + diff = self._compare_dirs(tmpdir, tmpdir3) + self.assertEqual(diff, []) + self.assertRaises(shutil.ReadError, unpack_archive, TESTFN) + self.assertRaises(ValueError, unpack_archive, TESTFN, format='xxx') + def test_unpack_registery(self): formats = get_unpack_formats() |