bpo-23596: Add unit tests for the command line for the gzip module #9775
Conversation
Thanks for the PR @matrixise |
out, err = proc.communicate(bytes_io.getvalue()) | ||
|
||
self.assertEqual(err, b'') | ||
self.assertNotEqual(out, b'') |
JulienPalard
Oct 9, 2018
Member
Why not an assertEqual(out, self.data)
?
Why not an assertEqual(out, self.data)
?
out, err = proc.communicate(self.data) | ||
|
||
self.assertEqual(err, b'') | ||
self.assertNotEqual(out, b'') |
JulienPalard
Oct 9, 2018
Member
Why not self.assertEqual(out[:2], b"\x1f\x8b")
(the gzip identification bytes)?
Why not self.assertEqual(out[:2], b"\x1f\x8b")
(the gzip identification bytes)?
|
||
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:")) |
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.
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.
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 |
Thanks @matrixise for the PR, and @JulienPalard for merging it |
…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>
GH-9779 is a backport of this pull request to the 3.7 branch. |
…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>
GH-9780 is a backport of this pull request to the 3.6 branch. |
…ythonGH-9775) Add unit tests for the command line for the gzip module
https://bugs.python.org/issue23596