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

Method test_epilogue

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

Source from the content-addressed store, hash-verified

2636 '<002001c144a6$8752e060$56104586@oxy.edu>')
2637
2638 def test_epilogue(self):
2639 eq = self.ndiffAssertEqual
2640 with openfile('msg_21.txt', encoding="utf-8") as fp:
2641 text = fp.read()
2642 msg = Message()
2643 msg['From'] = 'aperson@dom.ain'
2644 msg['To'] = 'bperson@dom.ain'
2645 msg['Subject'] = 'Test'
2646 msg.preamble = 'MIME message'
2647 msg.epilogue = 'End of MIME message\n'
2648 msg1 = MIMEText('One')
2649 msg2 = MIMEText('Two')
2650 msg.add_header('Content-Type', 'multipart/mixed', boundary='BOUNDARY')
2651 msg.attach(msg1)
2652 msg.attach(msg2)
2653 sfp = StringIO()
2654 g = Generator(sfp)
2655 g.flatten(msg)
2656 eq(sfp.getvalue(), text)
2657
2658 def test_no_nl_preamble(self):
2659 eq = self.ndiffAssertEqual

Callers

nothing calls this directly

Calls 11

add_headerMethod · 0.95
attachMethod · 0.95
flattenMethod · 0.95
getvalueMethod · 0.95
openfileFunction · 0.90
MessageClass · 0.90
MIMETextClass · 0.90
StringIOClass · 0.90
GeneratorClass · 0.90
eqFunction · 0.85
readMethod · 0.45

Tested by

no test coverage detected