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

Method test_codec_encodeable

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

Source from the content-addressed store, hash-verified

4962 pass
4963
4964 def test_codec_encodeable(self):
4965 eq = self.assertEqual
4966 # Make sure us-ascii = no Unicode conversion
4967 c = Charset('us-ascii')
4968 eq(c.header_encode('Hello World!'), 'Hello World!')
4969 # Test 8-bit idempotency with us-ascii
4970 s = '\xa4\xa2\xa4\xa4\xa4\xa6\xa4\xa8\xa4\xaa'
4971 self.assertRaises(UnicodeError, c.header_encode, s)
4972 c = Charset('utf-8')
4973 eq(c.header_encode(s), '=?utf-8?b?wqTCosKkwqTCpMKmwqTCqMKkwqo=?=')
4974
4975 def test_body_encode(self):
4976 eq = self.assertEqual

Callers

nothing calls this directly

Calls 4

header_encodeMethod · 0.95
CharsetClass · 0.90
eqFunction · 0.85
assertRaisesMethod · 0.45

Tested by

no test coverage detected