MCPcopy Create free account
hub / github.com/python/cpython / test_crlf_separation

Method test_crlf_separation

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

Source from the content-addressed store, hash-verified

4003 eq(msg.get_payload(), "Here's the message body\n")
4004
4005 def test_crlf_separation(self):
4006 eq = self.assertEqual
4007 with openfile('msg_26.txt', encoding="utf-8", newline='\n') as fp:
4008 msg = Parser().parse(fp)
4009 eq(len(msg.get_payload()), 2)
4010 part1 = msg.get_payload(0)
4011 eq(part1.get_content_type(), 'text/plain')
4012 eq(part1.get_payload(), 'Simple email with attachment.\r\n\r\n')
4013 part2 = msg.get_payload(1)
4014 eq(part2.get_content_type(), 'application/riscos')
4015
4016 def test_crlf_flatten(self):
4017 # Using newline='\n' preserves the crlfs in this input file.

Callers

nothing calls this directly

Calls 6

openfileFunction · 0.90
ParserClass · 0.90
eqFunction · 0.85
get_payloadMethod · 0.80
get_content_typeMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected