summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tarfile.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-02-10 06:47:10 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-02-10 06:47:10 (GMT)
commit4bdcfce5129fbf2d710046b4d3f9be636e9e0898 (patch)
tree4f4eb016460584352945779f7199fd68eb1728a2 /Lib/test/test_tarfile.py
parent5ef01e9b93493a1ca8746b956a70972ef52b3791 (diff)
parent832dd5f0d65d3a0ebd7d7c7a3a4c80ab5170cd08 (diff)
downloadcpython-4bdcfce5129fbf2d710046b4d3f9be636e9e0898.zip
cpython-4bdcfce5129fbf2d710046b4d3f9be636e9e0898.tar.gz
cpython-4bdcfce5129fbf2d710046b4d3f9be636e9e0898.tar.bz2
Issue #23421: Fixed compression in tarfile CLI. Patch by wdv4758h.
Diffstat (limited to 'Lib/test/test_tarfile.py')
-rw-r--r--Lib/test/test_tarfile.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index 810b76b..ef71f5e 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -2006,6 +2006,21 @@ class CommandLineTest(unittest.TestCase):
finally:
support.unlink(tar_name)
+ def test_create_command_compressed(self):
+ files = [support.findfile('tokenize_tests.txt'),
+ support.findfile('tokenize_tests-no-coding-cookie-'
+ 'and-utf8-bom-sig-only.txt')]
+ for filetype in (GzipTest, Bz2Test, LzmaTest):
+ if not filetype.open:
+ continue
+ try:
+ tar_name = tmpname + '.' + filetype.suffix
+ out = self.tarfilecmd('-c', tar_name, *files)
+ with filetype.taropen(tar_name) as tar:
+ tar.getmembers()
+ finally:
+ support.unlink(tar_name)
+
def test_extract_command(self):
self.make_simple_tarfile(tmpname)
for opt in '-e', '--extract':