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

Method test_message_from_file

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

Source from the content-addressed store, hash-verified

3016 self.assertEqual(text, s.getvalue())
3017
3018 def test_message_from_file(self):
3019 with openfile('msg_01.txt', encoding="utf-8") as fp:
3020 text = fp.read()
3021 fp.seek(0)
3022 msg = email.message_from_file(fp)
3023 s = StringIO()
3024 # Don't wrap/continue long headers since we're trying to test
3025 # idempotency.
3026 g = Generator(s, maxheaderlen=0)
3027 g.flatten(msg)
3028 self.assertEqual(text, s.getvalue())
3029
3030 def test_message_from_string_with_class(self):
3031 with openfile('msg_01.txt', encoding="utf-8") as fp:

Callers

nothing calls this directly

Calls 8

flattenMethod · 0.95
getvalueMethod · 0.95
openfileFunction · 0.90
StringIOClass · 0.90
GeneratorClass · 0.90
readMethod · 0.45
seekMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected