[Python-checkins] python/dist/src/Lib/email/test test_email.py, 1.50.10.5, 1.50.10.6

bwarsaw at users.sourceforge.net bwarsaw at users.sourceforge.net
Sat Nov 6 01:13:48 CET 2004


Update of /cvsroot/python/python/dist/src/Lib/email/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11344

Modified Files:
      Tag: release23-maint
	test_email.py 
Log Message:
test_boundary_with_leading_space(): Test case for SF bug #1060941.  RFC 2046
says boundaries may begin -- but not end -- with whitespace.


Index: test_email.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v
retrieving revision 1.50.10.5
retrieving revision 1.50.10.6
diff -u -d -r1.50.10.5 -r1.50.10.6
--- test_email.py	16 Aug 2004 15:31:43 -0000	1.50.10.5
+++ test_email.py	6 Nov 2004 00:13:46 -0000	1.50.10.6
@@ -1203,6 +1203,25 @@
 ----961284236552522269--
 ''')
 
+    def test_boundary_with_leading_space(self):
+        eq = self.assertEqual
+        msg = email.message_from_string('''\
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="    XXXX"
+
+--    XXXX
+Content-Type: text/plain
+
+
+--    XXXX
+Content-Type: text/plain
+
+--    XXXX--
+''')
+        self.failUnless(msg.is_multipart())
+        eq(msg.get_boundary(), '    XXXX')
+        eq(len(msg.get_payload()), 2)
+
 
 
 # Test some badly formatted messages



More information about the Python-checkins mailing list