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.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index 03fb55f..cd58c9a 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -212,6 +212,17 @@ class ReadStreamTest(ReadTest):
stream.close()
+class ReadDetectTest(ReadTest):
+
+ def setUp(self):
+ self.tar = tarfile.open(tarname(self.comp), self.mode)
+
+class ReadDetectFileobjTest(ReadTest):
+
+ def setUp(self):
+ name = tarname(self.comp)
+ self.tar = tarfile.open(name, mode=self.mode, fileobj=file(name))
+
class ReadAsteriskTest(ReadTest):
def setUp(self):
@@ -503,6 +514,10 @@ class WriteTestGzip(WriteTest):
comp = "gz"
class WriteStreamTestGzip(WriteStreamTest):
comp = "gz"
+class ReadDetectTestGzip(ReadDetectTest):
+ comp = "gz"
+class ReadDetectFileobjTestGzip(ReadDetectFileobjTest):
+ comp = "gz"
class ReadAsteriskTestGzip(ReadAsteriskTest):
comp = "gz"
class ReadStreamAsteriskTestGzip(ReadStreamAsteriskTest):
@@ -526,6 +541,10 @@ if bz2:
comp = "bz2"
class WriteStreamTestBzip2(WriteStreamTestGzip):
comp = "bz2"
+ class ReadDetectTestBzip2(ReadDetectTest):
+ comp = "bz2"
+ class ReadDetectFileobjTestBzip2(ReadDetectFileobjTest):
+ comp = "bz2"
class ReadAsteriskTestBzip2(ReadAsteriskTest):
comp = "bz2"
class ReadStreamAsteriskTestBzip2(ReadStreamAsteriskTest):
@@ -550,6 +569,8 @@ def test_main():
FileModeTest,
ReadTest,
ReadStreamTest,
+ ReadDetectTest,
+ ReadDetectFileobjTest,
ReadAsteriskTest,
ReadStreamAsteriskTest,
WriteTest,
@@ -567,6 +588,7 @@ def test_main():
tests.extend([
ReadTestGzip, ReadStreamTestGzip,
WriteTestGzip, WriteStreamTestGzip,
+ ReadDetectTestGzip, ReadDetectFileobjTestGzip,
ReadAsteriskTestGzip, ReadStreamAsteriskTestGzip
])
@@ -574,6 +596,7 @@ def test_main():
tests.extend([
ReadTestBzip2, ReadStreamTestBzip2,
WriteTestBzip2, WriteStreamTestBzip2,
+ ReadDetectTestBzip2, ReadDetectFileobjTestBzip2,
ReadAsteriskTestBzip2, ReadStreamAsteriskTestBzip2
])
try: