diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-10 06:45:53 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-10 06:45:53 (GMT) |
commit | 832dd5f0d65d3a0ebd7d7c7a3a4c80ab5170cd08 (patch) | |
tree | 8fa7e8aae8445c058cc8fa1e8408fb9502c1a15e /Lib/test | |
parent | 22ef9f722e6aa138d047625dd845c9a101c4454d (diff) | |
download | cpython-832dd5f0d65d3a0ebd7d7c7a3a4c80ab5170cd08.zip cpython-832dd5f0d65d3a0ebd7d7c7a3a4c80ab5170cd08.tar.gz cpython-832dd5f0d65d3a0ebd7d7c7a3a4c80ab5170cd08.tar.bz2 |
Issue #23421: Fixed compression in tarfile CLI. Patch by wdv4758h.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_tarfile.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index e527e40..c135304 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': |