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

bwarsaw at users.sourceforge.net bwarsaw at users.sourceforge.net
Mon Aug 16 17:31:45 CEST 2004


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

Modified Files:
      Tag: release23-maint
	test_email.py 
Log Message:
Test cases and fixes for bugs described in patch #873418: email/Message.py:
del_param fails when specifying a header.

I'll port this to Python 2.4 shortly.


Index: test_email.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v
retrieving revision 1.50.10.4
retrieving revision 1.50.10.5
diff -C2 -d -r1.50.10.4 -r1.50.10.5
*** test_email.py	13 May 2004 23:13:24 -0000	1.50.10.4
--- test_email.py	16 Aug 2004 15:31:43 -0000	1.50.10.5
***************
*** 362,365 ****
--- 362,371 ----
              ('report-type', old_val)])
  
+     def test_del_param_on_other_header(self):
+         msg = Message()
+         msg.add_header('Content-Disposition', 'attachment', filename='bud.gif')
+         msg.del_param('filename', 'content-disposition')
+         self.assertEqual(msg['content-disposition'], 'attachment')
+ 
      def test_set_type(self):
          eq = self.assertEqual
***************
*** 373,376 ****
--- 379,388 ----
          eq(msg['content-type'], 'text/html; charset="us-ascii"')
  
+     def test_set_type_on_other_header(self):
+         msg = Message()
+         msg['X-Content-Type'] = 'text/plain'
+         msg.set_type('application/octet-stream', 'X-Content-Type')
+         self.assertEqual(msg['x-content-type'], 'application/octet-stream')
+ 
      def test_get_content_type_missing(self):
          msg = Message()



More information about the Python-checkins mailing list