Skip to content

bpo-23596: Add unit tests for the command line for the gzip module#9775

Merged
JulienPalard merged 2 commits into
python:masterfrom
matrixise:bpo-23596
Oct 9, 2018
Merged

bpo-23596: Add unit tests for the command line for the gzip module#9775
JulienPalard merged 2 commits into
python:masterfrom
matrixise:bpo-23596

Conversation

@matrixise
Copy link
Copy Markdown
Member

@matrixise matrixise commented Oct 9, 2018

Copy link
Copy Markdown
Member

@JulienPalard JulienPalard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @matrixise

Comment thread Lib/test/test_gzip.py Outdated
out, err = proc.communicate(bytes_io.getvalue())

self.assertEqual(err, b'')
self.assertNotEqual(out, b'')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not an assertEqual(out, self.data)?

Comment thread Lib/test/test_gzip.py Outdated
out, err = proc.communicate(self.data)

self.assertEqual(err, b'')
self.assertNotEqual(out, b'')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not self.assertEqual(out[:2], b"\x1f\x8b") (the gzip identification bytes)?

Comment thread Lib/test/test_gzip.py
Comment thread Lib/test/test_gzip.py Outdated

def test_decompress_infile_outfile_error(self):
rc, out, err = assert_python_ok('-m', 'gzip', '-d', 'thisisatest.out')
self.assertTrue(out.startswith(b"filename doesn't end in .gz:"))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works, but what about an self.assertIn(b"filename doesn't end in .gz:", out)? Would probably produce a better error message, but does not check if the error is at the begining of the line.

@bedevere-bot
Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@miss-islington
Copy link
Copy Markdown
Contributor

Thanks @matrixise for the PR, and @JulienPalard for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 9, 2018
…ythonGH-9775)

Add unit tests for the command line for the gzip module
(cherry picked from commit 84eec11)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
@bedevere-bot
Copy link
Copy Markdown

GH-9779 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 9, 2018
…ythonGH-9775)

Add unit tests for the command line for the gzip module
(cherry picked from commit 84eec11)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
@bedevere-bot
Copy link
Copy Markdown

GH-9780 is a backport of this pull request to the 3.6 branch.

miss-islington added a commit that referenced this pull request Oct 9, 2018
…H-9775)

Add unit tests for the command line for the gzip module
(cherry picked from commit 84eec11)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
miss-islington added a commit that referenced this pull request Oct 9, 2018
…H-9775)

Add unit tests for the command line for the gzip module
(cherry picked from commit 84eec11)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants