MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_epilogue

Method test_epilogue

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

Source from the content-addressed store, hash-verified

2702 '<002001c144a6$8752e060$56104586@oxy.edu>')
2703
2704 def test_epilogue(self):
2705 eq = self.ndiffAssertEqual
2706 with openfile('msg_21.txt', encoding="utf-8") as fp:
2707 text = fp.read()
2708 msg = Message()
2709 msg['From'] = 'aperson@dom.ain'
2710 msg['To'] = 'bperson@dom.ain'
2711 msg['Subject'] = 'Test'
2712 msg.preamble = 'MIME message'
2713 msg.epilogue = 'End of MIME message\n'
2714 msg1 = MIMEText('One')
2715 msg2 = MIMEText('Two')
2716 msg.add_header('Content-Type', 'multipart/mixed', boundary='BOUNDARY')
2717 msg.attach(msg1)
2718 msg.attach(msg2)
2719 sfp = StringIO()
2720 g = Generator(sfp)
2721 g.flatten(msg)
2722 eq(sfp.getvalue(), text)
2723
2724 def test_no_nl_preamble(self):
2725 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.50
readMethod · 0.45

Tested by

no test coverage detected