Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(156883)

Unified Diff: Lib/test/test_tarfile.py

Issue 23421: tarfile module does not correctly choose compression algorithms
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -2006,6 +2006,22 @@
finally:
support.unlink(tar_name)
+ def test_create_command_filetype(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:
+ filename = tmpname + '.' + filetype.suffix
+ out = self.tarfilecmd('-c', filename, *files)
+ with filetype.taropen(filename, 'r') as tar:
+ pass
+ finally:
+ support.unlink(filename)
+
def test_extract_command(self):
self.make_simple_tarfile(tmpname)
for opt in '-e', '--extract':
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+