diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-01-13 17:07:33 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-01-13 17:07:33 (GMT) |
commit | 2a3d7d1af7ff00748f25bbd49a928f8af1a9990d (patch) | |
tree | 3b28655bf96e76f38e4820851c3cd60b096d62d4 | |
parent | 6cbc5f784fd07f1c1df3e749d429b3bef9d9cfd6 (diff) | |
download | cpython-2a3d7d1af7ff00748f25bbd49a928f8af1a9990d.zip cpython-2a3d7d1af7ff00748f25bbd49a928f8af1a9990d.tar.gz cpython-2a3d7d1af7ff00748f25bbd49a928f8af1a9990d.tar.bz2 |
Test the open of non-exitent tarfile in all modes.
-rw-r--r-- | Lib/test/test_tarfile.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index 238175f..18dd390 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -232,6 +232,12 @@ class CommonReadTest(ReadTest): finally: tar.close() + def test_non_existent_tarfile(self): + # Test for issue11513: prevent non-existent gzipped tarfiles raising + # multiple exceptions. + with self.assertRaisesRegex(FileNotFoundError, "xxx"): + tarfile.open("xxx", self.mode) + def test_null_tarfile(self): # Test for issue6123: Allow opening empty archives. # This test guarantees that tarfile.open() does not treat an empty @@ -444,11 +450,7 @@ class MiscReadTest(MiscReadTestBase, unittest.TestCase): test_fail_comp = None class GzipMiscReadTest(GzipTest, MiscReadTestBase, unittest.TestCase): - def test_non_existent_targz_file(self): - # Test for issue11513: prevent non-existent gzipped tarfiles raising - # multiple exceptions. - with self.assertRaisesRegex(FileNotFoundError, "xxx"): - tarfile.open("xxx", self.mode) + pass class Bz2MiscReadTest(Bz2Test, MiscReadTestBase, unittest.TestCase): def test_no_name_argument(self): |