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

Method test_header_parser

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

Source from the content-addressed store, hash-verified

3909class TestParsers(TestEmailBase):
3910
3911 def test_header_parser(self):
3912 eq = self.assertEqual
3913 # Parse only the headers of a complex multipart MIME document
3914 with openfile('msg_02.txt', encoding="utf-8") as fp:
3915 msg = HeaderParser().parse(fp)
3916 eq(msg['from'], 'ppp-request@zzz.org')
3917 eq(msg['to'], 'ppp@zzz.org')
3918 eq(msg.get_content_type(), 'multipart/mixed')
3919 self.assertFalse(msg.is_multipart())
3920 self.assertIsInstance(msg.get_payload(), str)
3921
3922 def test_bytes_header_parser(self):
3923 eq = self.assertEqual

Callers

nothing calls this directly

Calls 9

openfileFunction · 0.90
HeaderParserClass · 0.90
eqFunction · 0.85
get_content_typeMethod · 0.80
assertFalseMethod · 0.80
is_multipartMethod · 0.80
assertIsInstanceMethod · 0.80
get_payloadMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected