MCPcopy Index your code
hub / github.com/python/cpython / test_encode7or8bit

Method test_encode7or8bit

Lib/test/test_email/test_email.py:919–932  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

917 eq(msg['content-transfer-encoding'], 'quoted-printable')
918
919 def test_encode7or8bit(self):
920 # Make sure a charset whose input character set is 8bit but
921 # whose output character set is 7bit gets a transfer-encoding
922 # of 7bit.
923 eq = self.assertEqual
924 msg = MIMEText('文\n', _charset='euc-jp')
925 eq(msg['content-transfer-encoding'], '7bit')
926 eq(msg.as_string(), textwrap.dedent("""\
927 MIME-Version: 1.0
928 Content-Type: text/plain; charset="iso-2022-jp"
929 Content-Transfer-Encoding: 7bit
930
931 \x1b$BJ8\x1b(B
932 """))
933
934 def test_qp_encode_latin1(self):
935 msg = MIMEText('\xe1\xf6\n', 'text', 'ISO-8859-1')

Callers

nothing calls this directly

Calls 4

MIMETextClass · 0.90
eqFunction · 0.85
as_stringMethod · 0.45
dedentMethod · 0.45

Tested by

no test coverage detected