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

bwarsaw at users.sourceforge.net bwarsaw at users.sourceforge.net
Mon Aug 16 17:47:37 CEST 2004


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

Modified Files:
	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.


Index: test_email.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -d -r1.60 -r1.61
*** test_email.py	7 Aug 2004 16:38:39 -0000	1.60
--- test_email.py	16 Aug 2004 15:47:34 -0000	1.61
***************
*** 355,358 ****
--- 355,364 ----
              ('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
***************
*** 366,369 ****
--- 372,381 ----
          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