MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_codec_encodeable

Method test_codec_encodeable

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

Source from the content-addressed store, hash-verified

5032 pass
5033
5034 def test_codec_encodeable(self):
5035 eq = self.assertEqual
5036 # Make sure us-ascii = no Unicode conversion
5037 c = Charset('us-ascii')
5038 eq(c.header_encode('Hello World!'), 'Hello World!')
5039 # Test 8-bit idempotency with us-ascii
5040 s = '\xa4\xa2\xa4\xa4\xa4\xa6\xa4\xa8\xa4\xaa'
5041 self.assertRaises(UnicodeError, c.header_encode, s)
5042 c = Charset('utf-8')
5043 eq(c.header_encode(s), '=?utf-8?b?wqTCosKkwqTCpMKmwqTCqMKkwqo=?=')
5044
5045 def test_body_encode(self):
5046 eq = self.assertEqual

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected