comparison test/test_mailgw.py @ 3811:ccd55dc53410

Make functionality for matching In-Reply-To and Message-Id work... ...even when the issue id differs from the message id.. Improved test.
author Erik Forsberg <forsberg@users.sourceforge.net>
date Sun, 21 Jan 2007 18:08:31 +0000
parents 4536c0e544be
children 27b589d3b79d
comparison
equal deleted inserted replaced
3810:4536c0e544be 3811:ccd55dc53410
6 # 6 #
7 # This module is distributed in the hope that it will be useful, 7 # This module is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 # 10 #
11 # $Id: test_mailgw.py,v 1.81 2007-01-21 15:22:02 forsberg Exp $ 11 # $Id: test_mailgw.py,v 1.82 2007-01-21 18:08:31 forsberg Exp $
12 12
13 # TODO: test bcc 13 # TODO: test bcc
14 14
15 import unittest, tempfile, os, shutil, errno, imp, sys, difflib, rfc822, time 15 import unittest, tempfile, os, shutil, errno, imp, sys, difflib, rfc822, time
16 16
1284 self.assertEqual(self.db.issue.get(nodeid, 'title'), 1284 self.assertEqual(self.db.issue.get(nodeid, 'title'),
1285 'testing [assignedto=mary]') 1285 'testing [assignedto=mary]')
1286 self.assertEqual(self.db.issue.get(nodeid, 'assignedto'), None) 1286 self.assertEqual(self.db.issue.get(nodeid, 'assignedto'), None)
1287 1287
1288 def testReplytoMatch(self): 1288 def testReplytoMatch(self):
1289 self.instance.config.MAILGW_SUBJECT_PREFIX_PARSING = 'loose' 1289 self.instance.config.MAILGW_SUBJECT_PREFIX_PARSING = 'loose'
1290 nodeid = self.doNewIssue() 1290 nodeid = self.doNewIssue()
1291 nodeid2 = self._handle_mail('''Content-Type: text/plain; 1291 nodeid2 = self._handle_mail('''Content-Type: text/plain;
1292 charset="iso-8859-1" 1292 charset="iso-8859-1"
1293 From: Chef <chef@bork.bork.bork> 1293 From: Chef <chef@bork.bork.bork>
1294 To: issue_tracker@your.tracker.email.domain.example 1294 To: issue_tracker@your.tracker.email.domain.example
1296 In-Reply-To: <dummy_test_message_id> 1296 In-Reply-To: <dummy_test_message_id>
1297 Subject: Testing... 1297 Subject: Testing...
1298 1298
1299 Followup message. 1299 Followup message.
1300 ''') 1300 ''')
1301
1302 nodeid3 = self._handle_mail('''Content-Type: text/plain;
1303 charset="iso-8859-1"
1304 From: Chef <chef@bork.bork.bork>
1305 To: issue_tracker@your.tracker.email.domain.example
1306 Message-Id: <dummy_test_message_id3>
1307 In-Reply-To: <dummy_test_message_id2>
1308 Subject: Testing...
1309
1310 Yet another message in the same thread/issue.
1311 ''')
1312
1301 self.assertEqual(nodeid, nodeid2) 1313 self.assertEqual(nodeid, nodeid2)
1302 1314 self.assertEqual(nodeid, nodeid3)
1303 1315
1304 def test_suite(): 1316 def test_suite():
1305 suite = unittest.TestSuite() 1317 suite = unittest.TestSuite()
1306 suite.addTest(unittest.makeSuite(MailgwTestCase)) 1318 suite.addTest(unittest.makeSuite(MailgwTestCase))
1307 return suite 1319 return suite

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