[Python-checkins] CVS: python/dist/src/Lib/test test_email.py,1.12,1.13

Barry Warsaw bwarsaw@users.sourceforge.net
Thu, 18 Oct 2001 21:09:01 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv29156

Modified Files:
	test_email.py 
Log Message:
Another merge from mimelib:

    TestMIMEMessage.test_epilogue(), TestIdempotent.test_preamble_epilogue(): 
    Test cases for SF bug #472481.


Index: test_email.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_email.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** test_email.py	2001/10/18 21:57:37	1.12
--- test_email.py	2001/10/19 04:08:59	1.13
***************
*** 27,30 ****
--- 27,31 ----
  from test_support import findfile
  
+ 
  NL = '\n'
  EMPTYSTRING = ''
***************
*** 697,700 ****
--- 698,723 ----
             '<002001c144a6$8752e060$56104586@oxy.edu>')
  
+     def test_epilogue(self):
+         fp = openfile('msg_21.txt')
+         try:
+             text = fp.read()
+         finally:
+             fp.close()
+         msg = Message()
+         msg['From'] = 'aperson@dom.ain'
+         msg['To'] = 'bperson@dom.ain'
+         msg['Subject'] = 'Test'
+         msg.preamble = 'MIME message\n'
+         msg.epilogue = 'End of MIME message\n'
+         msg1 = MIMEText('One')
+         msg2 = MIMEText('Two')
+         msg.add_header('Content-Type', 'multipart/mixed', boundary='BOUNDARY')
+         msg.add_payload(msg1)
+         msg.add_payload(msg2)
+         sfp = StringIO()
+         g = Generator(sfp)
+         g(msg)
+         self.assertEqual(sfp.getvalue(), text)
+ 
  
  
***************
*** 759,762 ****
--- 782,789 ----
      def test_dsn(self):
          msg, text = self._msgobj('msg_16.txt')
+         self._idempotent(msg, text)
+ 
+     def test_preamble_epilogue(self):
+         msg, text = self._msgobj('msg_21.txt')
          self._idempotent(msg, text)