Yves Dorfsman <y...@zioup.com> added the comment:

I've got two issues with this code (Lib/email/test/test_email.py):


1128     def test_body(self):
1129         eq = self.assertEqual
1130         bytes = b'\xfa\xfb\xfc\xfd\xfe\xff'
1131         msg = MIMEApplication(bytes)
1132         eq(msg.get_payload(), '+vv8/f7/')
1133         eq(msg.get_payload(decode=True), bytes)

1) Even though it works, I find the use of a defined type as the name of a 
variable confusing (line 1130, bytes).

2) The test on line 1132 fails if the base64 payload has an extra newline at 
the end, but newlines are not an issue in base64 and are actually expected. In 
fact the test at line 1133 shows that once decoded, the bytes are reverted to 
their original form.

Is there a way to find who is the author of this test, and what was the intent? 
Would the following test be acceptable (still testing a valid base64 encoding):

eq(msg.get_payload().strip(), '+vv8/f7/')


Thanks.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9298>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to