summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tarfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_tarfile.py')
-rw-r--r--Lib/test/test_tarfile.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index c2abc7e..c9c1097 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -513,6 +513,7 @@ class CommonReadTest(ReadTest):
with self.tar.extractfile(file) as fobj:
self.assertEqual(fobj.name, 'ustar/regtype')
self.assertRaises(AttributeError, fobj.fileno)
+ self.assertEqual(fobj.mode, 'rb')
self.assertIs(fobj.readable(), True)
self.assertIs(fobj.writable(), False)
if self.is_stream:
@@ -523,6 +524,7 @@ class CommonReadTest(ReadTest):
self.assertIs(fobj.closed, True)
self.assertEqual(fobj.name, 'ustar/regtype')
self.assertRaises(AttributeError, fobj.fileno)
+ self.assertEqual(fobj.mode, 'rb')
self.assertIs(fobj.readable(), True)
self.assertIs(fobj.writable(), False)
if self.is_stream:
@@ -533,11 +535,8 @@ class CommonReadTest(ReadTest):
class MiscReadTestBase(CommonReadTest):
is_stream = False
- def requires_name_attribute(self):
- pass
def test_no_name_argument(self):
- self.requires_name_attribute()
with open(self.tarname, "rb") as fobj:
self.assertIsInstance(fobj.name, str)
with tarfile.open(fileobj=fobj, mode=self.mode) as tar:
@@ -570,7 +569,6 @@ class MiscReadTestBase(CommonReadTest):
self.assertIsNone(tar.name)
def test_bytes_name_attribute(self):
- self.requires_name_attribute()
tarname = os.fsencode(self.tarname)
with open(tarname, 'rb') as fobj:
self.assertIsInstance(fobj.name, bytes)
@@ -839,12 +837,10 @@ class GzipMiscReadTest(GzipTest, MiscReadTestBase, unittest.TestCase):
pass
class Bz2MiscReadTest(Bz2Test, MiscReadTestBase, unittest.TestCase):
- def requires_name_attribute(self):
- self.skipTest("BZ2File have no name attribute")
+ pass
class LzmaMiscReadTest(LzmaTest, MiscReadTestBase, unittest.TestCase):
- def requires_name_attribute(self):
- self.skipTest("LZMAFile have no name attribute")
+ pass
class StreamReadTest(CommonReadTest, unittest.TestCase):