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

Method test_message_rfc822_only

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

Source from the content-addressed store, hash-verified

216 # XXX: there ought to be tests of the uniqueness of the boundary, too.
217
218 def test_message_rfc822_only(self):
219 # Issue 7970: message/rfc822 not in multipart parsed by
220 # HeaderParser caused an exception when flattened.
221 with openfile('msg_46.txt', encoding="utf-8") as fp:
222 msgdata = fp.read()
223 parser = HeaderParser()
224 msg = parser.parsestr(msgdata)
225 out = StringIO()
226 gen = Generator(out, True, 0)
227 gen.flatten(msg, False)
228 self.assertEqual(out.getvalue(), msgdata)
229
230 def test_byte_message_rfc822_only(self):
231 # Make sure new bytes header parser also passes this.

Callers

nothing calls this directly

Calls 9

parsestrMethod · 0.95
flattenMethod · 0.95
getvalueMethod · 0.95
openfileFunction · 0.90
HeaderParserClass · 0.90
StringIOClass · 0.90
GeneratorClass · 0.90
readMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected