diff test/test_mailgw.py @ 1410:3a853f1c20b5 maint-0.5

backporting fixes from HEAD
author Richard Jones <richard@users.sourceforge.net>
date Thu, 06 Feb 2003 05:44:49 +0000
parents 83f33642d220
children 905f92b97d4e
line wrap: on
line diff
--- a/test/test_mailgw.py	Fri Jan 24 06:42:32 2003 +0000
+++ b/test/test_mailgw.py	Thu Feb 06 05:44:49 2003 +0000
@@ -8,7 +8,7 @@
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 #
-# $Id: test_mailgw.py,v 1.37 2002-12-18 00:42:03 richard Exp $
+# $Id: test_mailgw.py,v 1.37.2.1 2003-02-06 05:44:49 richard Exp $
 
 import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib
 
@@ -780,6 +780,41 @@
 _______________________________________________________________________
 ''')
 
+    def testContentDisposition(self):
+        self.doNewIssue()
+        message = cStringIO.StringIO('''Content-Type: text/plain;
+  charset="iso-8859-1"
+From: mary <mary@test>
+To: issue_tracker@your.tracker.email.domain.example
+Message-Id: <followup_dummy_id>
+In-Reply-To: <dummy_test_message_id>
+Subject: [issue1] Testing...
+Content-Type: multipart/mixed; boundary="bCsyhTFzCvuiizWE" 
+Content-Disposition: inline 
+ 
+ 
+--bCsyhTFzCvuiizWE 
+Content-Type: text/plain; charset=us-ascii 
+Content-Disposition: inline 
+
+test attachment binary 
+
+--bCsyhTFzCvuiizWE 
+Content-Type: application/octet-stream 
+Content-Disposition: attachment; filename="main.dvi" 
+
+xxxxxx 
+
+--bCsyhTFzCvuiizWE--
+''')
+        handler = self.instance.MailGW(self.instance, self.db)
+        handler.trapExceptions = 0
+        handler.main(message)
+        messages = self.db.issue.get('1', 'messages')
+        messages.sort()
+        file = self.db.msg.get(messages[-1], 'files')[0]
+        self.assertEqual(self.db.file.get(file, 'name'), 'main.dvi')
+
     def testFollowupStupidQuoting(self):
         self.doNewIssue()
 

Roundup Issue Tracker: http://roundup-tracker.org/