mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
Test the open of non-exitent tarfile in all modes.
This commit is contained in:
parent
a51791aa94
commit
f22fe0f507
1 changed files with 7 additions and 5 deletions
|
@ -234,6 +234,12 @@ class CommonReadTest(ReadTest):
|
||||||
finally:
|
finally:
|
||||||
tar.close()
|
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):
|
def test_null_tarfile(self):
|
||||||
# Test for issue6123: Allow opening empty archives.
|
# Test for issue6123: Allow opening empty archives.
|
||||||
# This test guarantees that tarfile.open() does not treat an empty
|
# This test guarantees that tarfile.open() does not treat an empty
|
||||||
|
@ -446,11 +452,7 @@ class MiscReadTest(MiscReadTestBase, unittest.TestCase):
|
||||||
test_fail_comp = None
|
test_fail_comp = None
|
||||||
|
|
||||||
class GzipMiscReadTest(GzipTest, MiscReadTestBase, unittest.TestCase):
|
class GzipMiscReadTest(GzipTest, MiscReadTestBase, unittest.TestCase):
|
||||||
def test_non_existent_targz_file(self):
|
pass
|
||||||
# Test for issue11513: prevent non-existent gzipped tarfiles raising
|
|
||||||
# multiple exceptions.
|
|
||||||
with self.assertRaisesRegex(FileNotFoundError, "xxx"):
|
|
||||||
tarfile.open("xxx", self.mode)
|
|
||||||
|
|
||||||
class Bz2MiscReadTest(Bz2Test, MiscReadTestBase, unittest.TestCase):
|
class Bz2MiscReadTest(Bz2Test, MiscReadTestBase, unittest.TestCase):
|
||||||
def test_no_name_argument(self):
|
def test_no_name_argument(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue