From 832dd5f0d65d3a0ebd7d7c7a3a4c80ab5170cd08 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Tue, 10 Feb 2015 08:45:53 +0200 Subject: Issue #23421: Fixed compression in tarfile CLI. Patch by wdv4758h. --- Lib/test/test_tarfile.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Lib/test/test_tarfile.py') diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index e527e403fa..c135304f40 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -1994,6 +1994,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': -- cgit v1.2.1