Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Oct 9, 2018

Conversation

@matrixise
Copy link
Member

@matrixise matrixise commented Oct 9, 2018

Copy link
Member

@JulienPalard JulienPalard left a comment

Thanks for the PR @matrixise

out, err = proc.communicate(bytes_io.getvalue())

self.assertEqual(err, b'')
self.assertNotEqual(out, b'')

This comment has been minimized.

@JulienPalard

JulienPalard Oct 9, 2018
Member

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

out, err = proc.communicate(self.data)

self.assertEqual(err, b'')
self.assertNotEqual(out, b'')

This comment has been minimized.

@JulienPalard

JulienPalard Oct 9, 2018
Member

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

Lib/test/test_gzip.py Show resolved Hide resolved

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:"))

This comment has been minimized.

@JulienPalard

JulienPalard Oct 9, 2018
Member

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

@bedevere-bot bedevere-bot commented Oct 9, 2018

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.

@JulienPalard JulienPalard merged commit 84eec11 into python:master Oct 9, 2018
5 checks passed
5 checks passed
Azure Pipelines PR #20181009.36 succeeded
Details
bedevere/issue-number Issue number 23596 found
Details
bedevere/news "skip news" label found
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Oct 9, 2018

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 added 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

@bedevere-bot bedevere-bot commented Oct 9, 2018

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

miss-islington added 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

@bedevere-bot bedevere-bot commented Oct 9, 2018

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>
yahya-abou-imran added a commit to yahya-abou-imran/cpython that referenced this pull request Nov 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants