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

Method test_multiline_header

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

Source from the content-addressed store, hash-verified

2493 self.assertEqual(str(make_header(decode_header(s))), '(a b)')
2494
2495 def test_multiline_header(self):
2496 s = '=?windows-1252?q?=22M=FCller_T=22?=\r\n <T.Mueller@xxx.com>'
2497 self.assertEqual(decode_header(s),
2498 [(b'"M\xfcller T"', 'windows-1252'),
2499 (b'<T.Mueller@xxx.com>', None)])
2500 self.assertEqual(make_header(decode_header(s)).encode(),
2501 ''.join(s.splitlines()))
2502 self.assertEqual(str(make_header(decode_header(s))),
2503 '"Müller T" <T.Mueller@xxx.com>')
2504
2505 def test_unencoded_ascii(self):
2506 # bpo-22833/gh-67022: returns [(str, None)] rather than [(bytes, None)]

Callers

nothing calls this directly

Calls 7

decode_headerFunction · 0.90
make_headerFunction · 0.90
strFunction · 0.85
assertEqualMethod · 0.45
encodeMethod · 0.45
joinMethod · 0.45
splitlinesMethod · 0.45

Tested by

no test coverage detected