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

Method test_rfc2047_multiline

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

Source from the content-addressed store, hash-verified

2443# Test RFC 2047 header encoding and decoding
2444class TestRFC2047(TestEmailBase):
2445 def test_rfc2047_multiline(self):
2446 eq = self.assertEqual
2447 s = """Re: =?mac-iceland?q?r=8Aksm=9Arg=8Cs?= baz
2448 foo bar =?mac-iceland?q?r=8Aksm=9Arg=8Cs?="""
2449 dh = decode_header(s)
2450 eq(dh, [
2451 (b'Re: ', None),
2452 (b'r\x8aksm\x9arg\x8cs', 'mac-iceland'),
2453 (b' baz foo bar ', None),
2454 (b'r\x8aksm\x9arg\x8cs', 'mac-iceland')])
2455 header = make_header(dh)
2456 eq(str(header),
2457 'Re: r\xe4ksm\xf6rg\xe5s baz foo bar r\xe4ksm\xf6rg\xe5s')
2458 self.ndiffAssertEqual(header.encode(maxlinelen=76), """\
2459Re: =?mac-iceland?q?r=8Aksm=9Arg=8Cs?= baz foo bar =?mac-iceland?q?r=8Aksm?=
2460 =?mac-iceland?q?=9Arg=8Cs?=""")
2461
2462 def test_whitespace_keeper_unicode(self):
2463 eq = self.assertEqual

Callers

nothing calls this directly

Calls 5

decode_headerFunction · 0.90
make_headerFunction · 0.90
strFunction · 0.85
eqFunction · 0.50
encodeMethod · 0.45

Tested by

no test coverage detected