[Python-checkins] python/dist/src/Lib/email/test test_email.py,1.29.4.3,1.29.4.4
bwarsaw@users.sourceforge.net
bwarsaw@users.sourceforge.net
Mon, 03 Mar 2003 08:33:44 -0800
Update of /cvsroot/python/python/dist/src/Lib/email/test
In directory sc8-pr-cvs1:/tmp/cvs-serv16057
Modified Files:
Tag: folding-reimpl-branch
test_email.py
Log Message:
test_no_nl_preamble(): New test for preamble not being line
terminated.
Index: test_email.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v
retrieving revision 1.29.4.3
retrieving revision 1.29.4.4
diff -C2 -d -r1.29.4.3 -r1.29.4.4
*** test_email.py 3 Mar 2003 15:40:28 -0000 1.29.4.3
--- test_email.py 3 Mar 2003 16:33:35 -0000 1.29.4.4
***************
*** 1345,1348 ****
--- 1345,1385 ----
self.assertEqual(sfp.getvalue(), text)
+ def test_no_nl_preamble(self):
+ eq = self.ndiffAssertEqual
+ msg = Message()
+ msg['From'] = 'aperson@dom.ain'
+ msg['To'] = 'bperson@dom.ain'
+ msg['Subject'] = 'Test'
+ msg.preamble = 'MIME message'
+ msg.epilogue = ''
+ msg1 = MIMEText('One')
+ msg2 = MIMEText('Two')
+ msg.add_header('Content-Type', 'multipart/mixed', boundary='BOUNDARY')
+ msg.attach(msg1)
+ msg.attach(msg2)
+ eq(msg.as_string(), """\
+ From: aperson@dom.ain
+ To: bperson@dom.ain
+ Subject: Test
+ Content-Type: multipart/mixed; boundary="BOUNDARY"
+
+ MIME message
+ --BOUNDARY
+ Content-Type: text/plain; charset="us-ascii"
+ MIME-Version: 1.0
+ Content-Transfer-Encoding: 7bit
+
+ One
+
+ --BOUNDARY
+ Content-Type: text/plain; charset="us-ascii"
+ MIME-Version: 1.0
+ Content-Transfer-Encoding: 7bit
+
+ Two
+
+ --BOUNDARY--
+ """)
+
def test_default_type(self):
eq = self.assertEqual