diff options
author | R David Murray <rdmurray@bitdance.com> | 2013-12-13 02:40:20 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2013-12-13 02:40:20 (GMT) |
commit | 775632ba107fb37dfe2d38a39e129f1daad070cf (patch) | |
tree | d7dbab56a10db1d7870c140cfcf3adbeb06430d1 /Lib/test/test_email | |
parent | cd0cb8ccd376186f08fd3ee2be0085f45f66b3d3 (diff) | |
download | cpython-775632ba107fb37dfe2d38a39e129f1daad070cf.zip cpython-775632ba107fb37dfe2d38a39e129f1daad070cf.tar.gz cpython-775632ba107fb37dfe2d38a39e129f1daad070cf.tar.bz2 |
#19957: Simplify encode_7or8bit now that _payload is always str.
Patch by Vajrasky Kok, test enhancement by me.
Diffstat (limited to 'Lib/test/test_email')
-rw-r--r-- | Lib/test/test_email/test_email.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py index 51a9438..ded3562 100644 --- a/Lib/test/test_email/test_email.py +++ b/Lib/test/test_email/test_email.py @@ -765,8 +765,15 @@ class TestEncoders(unittest.TestCase): # whose output character set is 7bit gets a transfer-encoding # of 7bit. eq = self.assertEqual - msg = MIMEText('文', _charset='euc-jp') + msg = MIMEText('文\n', _charset='euc-jp') eq(msg['content-transfer-encoding'], '7bit') + eq(msg.as_string(), textwrap.dedent("""\ + MIME-Version: 1.0 + Content-Type: text/plain; charset="iso-2022-jp" + Content-Transfer-Encoding: 7bit + + \x1b$BJ8\x1b(B + """)) def test_qp_encode_latin1(self): msg = MIMEText('\xe1\xf6\n', 'text', 'ISO-8859-1') |