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

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

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

self.assertEqual(err, b'')
self.assertNotEqual(out, b'')
Copy link
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)?

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

self.assertEqual(err, b'')
self.assertNotEqual(out, b'')
Copy link
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)?

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

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

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

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.

None yet

5 participants