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

bwarsaw at users.sourceforge.net bwarsaw at users.sourceforge.net
Mon Aug 18 22:52:32 EDT 2003


Update of /cvsroot/python/python/dist/src/Lib/email/test
In directory sc8-pr-cvs1:/tmp/cvs-serv20308/Lib/email/test

Modified Files:
      Tag: release23-maint
	test_email.py 
Log Message:
Backporting email 2.5.4 fixes from the trunk.


Index: test_email.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v
retrieving revision 1.50
retrieving revision 1.50.10.1
diff -C2 -d -r1.50 -r1.50.10.1
*** test_email.py	8 May 2003 03:34:01 -0000	1.50
--- test_email.py	19 Aug 2003 04:52:29 -0000	1.50.10.1
***************
*** 2660,2663 ****
--- 2660,2700 ----
                           (None, None, 'file____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEMP_nsmail.htm'))
  
+     def test_rfc2231_no_language_or_charset_in_filename(self):
+         m = '''\
+ Content-Disposition: inline;
+ \tfilename*0="This%20is%20even%20more%20";
+ \tfilename*1="%2A%2A%2Afun%2A%2A%2A%20";
+ \tfilename*2="is it not.pdf"
+ 
+ '''
+         msg = email.message_from_string(m)
+         self.assertEqual(msg.get_filename(),
+                          'This is even more ***fun*** is it not.pdf')
+ 
+     def test_rfc2231_no_language_or_charset_in_boundary(self):
+         m = '''\
+ Content-Type: multipart/alternative;
+ \tboundary*0="This%20is%20even%20more%20";
+ \tboundary*1="%2A%2A%2Afun%2A%2A%2A%20";
+ \tboundary*2="is it not.pdf"
+ 
+ '''
+         msg = email.message_from_string(m)
+         self.assertEqual(msg.get_boundary(),
+                          'This is even more ***fun*** is it not.pdf')
+ 
+     def test_rfc2231_no_language_or_charset_in_charset(self):
+         # This is a nonsensical charset value, but tests the code anyway
+         m = '''\
+ Content-Type: text/plain;
+ \tcharset*0="This%20is%20even%20more%20";
+ \tcharset*1="%2A%2A%2Afun%2A%2A%2A%20";
+ \tcharset*2="is it not.pdf"
+ 
+ '''
+         msg = email.message_from_string(m)
+         self.assertEqual(msg.get_content_charset(),
+                          'this is even more ***fun*** is it not.pdf')
+ 
  
  





More information about the Python-checkins mailing list