[Python-checkins] python/dist/src/Lib/email/test test_email.py,1.8,1.9
bwarsaw@users.sourceforge.net
bwarsaw@users.sourceforge.net
Tue, 10 Sep 2002 08:46:47 -0700
Update of /cvsroot/python/python/dist/src/Lib/email/test
In directory usw-pr-cvs1:/tmp/cvs-serv23596/email/test
Modified Files:
test_email.py
Log Message:
test_splitting_first_line_only_is_long(): New test for SF bug #601392,
broken wrapping of long ASCII headers.
Index: test_email.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** test_email.py 6 Sep 2002 03:56:26 -0000 1.8
--- test_email.py 10 Sep 2002 15:46:44 -0000 1.9
***************
*** 688,691 ****
--- 688,707 ----
\tSat, 2 Feb 2002 17:00:06 -0800 (PST)""")
+ def test_splitting_first_line_only_is_long(self):
+ eq = self.ndiffAssertEqual
+ hstr = """\
+ from modemcable093.139-201-24.que.mc.videotron.ca ([24.201.139.93] helo=cthulhu.gerg.ca)
+ \tby kronos.mems-exchange.org with esmtp (Exim 4.05)
+ \tid 17k4h5-00034i-00
+ \tfor test@mems-exchange.org; Wed, 28 Aug 2002 11:25:20 -0400"""
+ h = Header(hstr, maxlinelen=78, header_name='Received',
+ continuation_ws='\t')
+ eq(h.encode(), """\
+ from modemcable093.139-201-24.que.mc.videotron.ca ([24.201.139.93]
+ \thelo=cthulhu.gerg.ca)
+ \tby kronos.mems-exchange.org with esmtp (Exim 4.05)
+ \tid 17k4h5-00034i-00
+ \tfor test@mems-exchange.org; Wed, 28 Aug 2002 11:25:20 -0400""")
+
***************
*** 1012,1016 ****
finally:
fp.close()
! p = Parser()
# Note, under a future non-strict parsing mode, this would parse the
# message into the intended message tree.
--- 1028,1032 ----
finally:
fp.close()
! p = Parser(strict=1)
# Note, under a future non-strict parsing mode, this would parse the
# message into the intended message tree.
***************
*** 1046,1049 ****
--- 1062,1082 ----
neq(s.getvalue(), 'Content-Type: foo\n\n')
+ def test_no_start_boundary(self):
+ eq = self.ndiffAssertEqual
+ msg = self._msgobj('msg_31.txt')
+ eq(msg.get_payload(), """\
+ --BOUNDARY
+ Content-Type: text/plain
+
+ message 1
+
+ --BOUNDARY
+ Content-Type: text/plain
+
+ message 2
+
+ --BOUNDARY--
+ """)
+
***************
*** 1427,1430 ****
--- 1460,1467 ----
def test_multipart_no_parts(self):
msg, text = self._msgobj('msg_24.txt')
+ self._idempotent(msg, text)
+
+ def test_no_start_boundary(self):
+ msg, text = self._msgobj('msg_31.txt')
self._idempotent(msg, text)