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

Method test_long_8bit_header

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

Source from the content-addressed store, hash-verified

1329\tfor test@mems-exchange.org; Wed, 28 Aug 2002 11:25:20 -0400""")
1330
1331 def test_long_8bit_header(self):
1332 eq = self.ndiffAssertEqual
1333 msg = Message()
1334 h = Header('Britische Regierung gibt', 'iso-8859-1',
1335 header_name='Subject')
1336 h.append('gr\xfcnes Licht f\xfcr Offshore-Windkraftprojekte')
1337 eq(h.encode(maxlinelen=76), """\
1338=?iso-8859-1?q?Britische_Regierung_gibt_gr=FCnes_Licht_f=FCr_Offs?=
1339 =?iso-8859-1?q?hore-Windkraftprojekte?=""")
1340 msg['Subject'] = h
1341 eq(msg.as_string(maxheaderlen=76), """\
1342Subject: =?iso-8859-1?q?Britische_Regierung_gibt_gr=FCnes_Licht_f=FCr_Offs?=
1343 =?iso-8859-1?q?hore-Windkraftprojekte?=
1344
1345""")
1346 eq(msg.as_string(maxheaderlen=0), """\
1347Subject: =?iso-8859-1?q?Britische_Regierung_gibt_gr=FCnes_Licht_f=FCr_Offshore-Windkraftprojekte?=
1348
1349""")
1350
1351 def test_long_8bit_header_no_charset(self):
1352 eq = self.ndiffAssertEqual

Callers

nothing calls this directly

Calls 6

appendMethod · 0.95
encodeMethod · 0.95
as_stringMethod · 0.95
MessageClass · 0.90
HeaderClass · 0.90
eqFunction · 0.85

Tested by

no test coverage detected