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

Method test_escaped_8bit_header

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

Source from the content-addressed store, hash-verified

5295 eq(str(h), e)
5296
5297 def test_escaped_8bit_header(self):
5298 x = b'Ynwp4dUEbay Auction Semiar- No Charge \x96 Earn Big'
5299 e = x.decode('ascii', 'surrogateescape')
5300 h = Header(e, charset=email.charset.UNKNOWN8BIT)
5301 self.assertEqual(str(h),
5302 'Ynwp4dUEbay Auction Semiar- No Charge \uFFFD Earn Big')
5303 self.assertEqual(email.header.decode_header(h), [(x, 'unknown-8bit')])
5304
5305 def test_header_handles_binary_unknown8bit(self):
5306 x = b'Ynwp4dUEbay Auction Semiar- No Charge \x96 Earn Big'

Callers

nothing calls this directly

Calls 4

HeaderClass · 0.90
strFunction · 0.85
decodeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected