Code

956bc5fe9691b06857e8c46c7467b4477a28871d
[roundup.git] / test / test_mailgw.py
1 #
2 # Copyright (c) 2001 Richard Jones, richard@bofh.asn.au.
3 # This module is free software, and you may redistribute it and/or modify
4 # under the same terms as Python, so long as this copyright message and
5 # disclaimer are retained in their original form.
6 #
7 # This module is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 #
11 # $Id: test_mailgw.py,v 1.18 2002-05-15 03:27:16 richard Exp $
13 import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib
15 from roundup.mailgw import MailGW
16 from roundup import init, instance
18 # TODO: make this output only enough equal lines for context, not all of
19 # them
20 class DiffHelper:
21     def compareStrings(self, s2, s1):
22         '''Note the reversal of s2 and s1 - difflib.SequenceMatcher wants
23            the first to be the "original" but in the calls in this file,
24            the second arg is the original. Ho hum.
25         '''
26         if s1 == s2:
27             return
29         # under python2.[12] we allow a difference of one trailing empty line.
30         if sys.version_info[0:2] == (2,1):
31             if s1+'\n' == s2:
32                 return
33         if sys.version_info[0:2] == (2,2):
34             if s1 == s2+'\n':
35                 return
36         
37         l1=s1.split('\n')
38         l2=s2.split('\n')
39         s = difflib.SequenceMatcher(None, l1, l2)
40         res = ['Generated message not correct (diff follows):']
41         for value, s1s, s1e, s2s, s2e in s.get_opcodes():
42             if value == 'equal':
43                 for i in range(s1s, s1e):
44                     res.append('  %s'%l1[i])
45             elif value == 'delete':
46                 for i in range(s1s, s1e):
47                     res.append('- %s'%l1[i])
48             elif value == 'insert':
49                 for i in range(s2s, s2e):
50                     res.append('+ %s'%l2[i])
51             elif value == 'replace':
52                 for i, j in zip(range(s1s, s1e), range(s2s, s2e)):
53                     res.append('- %s'%l1[i])
54                     res.append('+ %s'%l2[j])
56         raise AssertionError, '\n'.join(res)
58 class MailgwTestCase(unittest.TestCase, DiffHelper):
59     count = 0
60     schema = 'classic'
61     def setUp(self):
62         MailgwTestCase.count = MailgwTestCase.count + 1
63         self.dirname = '_test_mailgw_%s'%self.count
64         try:
65             shutil.rmtree(self.dirname)
66         except OSError, error:
67             if error.errno not in (errno.ENOENT, errno.ESRCH): raise
68         # create the instance
69         init.init(self.dirname, self.schema, 'anydbm', 'sekrit')
70         # check we can load the package
71         self.instance = instance.open(self.dirname)
72         # and open the database
73         self.db = self.instance.open('sekrit')
74         self.db.user.create(username='Chef', address='chef@bork.bork.bork')
75         self.db.user.create(username='richard', address='richard@test')
76         self.db.user.create(username='mary', address='mary@test')
77         self.db.user.create(username='john', address='john@test',
78             alternate_addresses='jondoe@test\njohn.doe@test')
80     def tearDown(self):
81         if os.path.exists(os.environ['SENDMAILDEBUG']):
82             os.remove(os.environ['SENDMAILDEBUG'])
83         try:
84             shutil.rmtree(self.dirname)
85         except OSError, error:
86             if error.errno not in (errno.ENOENT, errno.ESRCH): raise
88     def testNewIssue(self):
89         message = cStringIO.StringIO('''Content-Type: text/plain;
90   charset="iso-8859-1"
91 From: Chef <chef@bork.bork.bork
92 To: issue_tracker@fill.me.in.
93 Cc: richard@test
94 Message-Id: <dummy_test_message_id>
95 Subject: [issue] Testing...
97 This is a test submission of a new issue.
98 ''')
99         handler = self.instance.MailGW(self.instance, self.db)
100         nodeid = handler.main(message)
101         if os.path.exists(os.environ['SENDMAILDEBUG']):
102             error = open(os.environ['SENDMAILDEBUG']).read()
103             self.assertEqual('no error', error)
104         l = self.db.issue.get(nodeid, 'nosy')
105         l.sort()
106         self.assertEqual(l, ['2', '3'])
108     def testNewIssueNosy(self):
109         self.instance.ADD_AUTHOR_TO_NOSY = 'yes'
110         message = cStringIO.StringIO('''Content-Type: text/plain;
111   charset="iso-8859-1"
112 From: Chef <chef@bork.bork.bork
113 To: issue_tracker@fill.me.in.
114 Cc: richard@test
115 Message-Id: <dummy_test_message_id>
116 Subject: [issue] Testing...
118 This is a test submission of a new issue.
119 ''')
120         handler = self.instance.MailGW(self.instance, self.db)
121         nodeid = handler.main(message)
122         if os.path.exists(os.environ['SENDMAILDEBUG']):
123             error = open(os.environ['SENDMAILDEBUG']).read()
124             self.assertEqual('no error', error)
125         l = self.db.issue.get(nodeid, 'nosy')
126         l.sort()
127         self.assertEqual(l, ['2', '3'])
129     def testAlternateAddress(self):
130         message = cStringIO.StringIO('''Content-Type: text/plain;
131   charset="iso-8859-1"
132 From: John Doe <john.doe@test>
133 To: issue_tracker@fill.me.in.
134 Message-Id: <dummy_test_message_id>
135 Subject: [issue] Testing...
137 This is a test submission of a new issue.
138 ''')
139         userlist = self.db.user.list()
140         handler = self.instance.MailGW(self.instance, self.db)
141         handler.main(message)
142         if os.path.exists(os.environ['SENDMAILDEBUG']):
143             error = open(os.environ['SENDMAILDEBUG']).read()
144             self.assertEqual('no error', error)
145         self.assertEqual(userlist, self.db.user.list(),
146             "user created when it shouldn't have been")
148     def testNewIssueNoClass(self):
149         message = cStringIO.StringIO('''Content-Type: text/plain;
150   charset="iso-8859-1"
151 From: Chef <chef@bork.bork.bork
152 To: issue_tracker@fill.me.in.
153 Cc: richard@test
154 Message-Id: <dummy_test_message_id>
155 Subject: Testing...
157 This is a test submission of a new issue.
158 ''')
159         handler = self.instance.MailGW(self.instance, self.db)
160         handler.main(message)
161         if os.path.exists(os.environ['SENDMAILDEBUG']):
162             error = open(os.environ['SENDMAILDEBUG']).read()
163             self.assertEqual('no error', error)
165     def testNewIssueAuthMsg(self):
166         message = cStringIO.StringIO('''Content-Type: text/plain;
167   charset="iso-8859-1"
168 From: Chef <chef@bork.bork.bork
169 To: issue_tracker@fill.me.in.
170 Message-Id: <dummy_test_message_id>
171 Subject: [issue] Testing... [nosy=mary; assignedto=richard]
173 This is a test submission of a new issue.
174 ''')
175         handler = self.instance.MailGW(self.instance, self.db)
176         # TODO: fix the damn config - this is apalling
177         self.db.config.MESSAGES_TO_AUTHOR = 'yes'
178         handler.main(message)
180         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
181 '''FROM: roundup-admin@fill.me.in.
182 TO: chef@bork.bork.bork, mary@test, richard@test
183 Content-Type: text/plain
184 Subject: [issue1] Testing...
185 To: chef@bork.bork.bork, mary@test, richard@test
186 From: Chef <issue_tracker@fill.me.in.>
187 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.>
188 MIME-Version: 1.0
189 Message-Id: <dummy_test_message_id>
190 X-Roundup-Name: Roundup issue tracker
191 Content-Transfer-Encoding: quoted-printable
194 New submission from Chef <chef@bork.bork.bork>:
196 This is a test submission of a new issue.
199 ----------
200 assignedto: richard
201 messages: 1
202 nosy: Chef, mary, richard
203 status: unread
204 title: Testing...
205 ___________________________________________________
206 "Roundup issue tracker" <issue_tracker@fill.me.in.>
207 http://some.useful.url/issue1
208 ___________________________________________________
209 ''')
211     # BUG
212     # def testMultipart(self):
213     #         '''With more than one part'''
214     #        see MultipartEnc tests: but if there is more than one part
215     #        we return a multipart/mixed and the boundary contains
216     #        the ip address of the test machine. 
218     # BUG should test some binary attamchent too.
220     def testFollowup(self):
221         self.testNewIssue()
222         message = cStringIO.StringIO('''Content-Type: text/plain;
223   charset="iso-8859-1"
224 From: richard <richard@test>
225 To: issue_tracker@fill.me.in.
226 Message-Id: <followup_dummy_id>
227 In-Reply-To: <dummy_test_message_id>
228 Subject: [issue1] Testing... [assignedto=mary; nosy=john]
230 This is a followup
231 ''')
232         handler = self.instance.MailGW(self.instance, self.db)
233         handler.main(message)
235         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
236 '''FROM: roundup-admin@fill.me.in.
237 TO: chef@bork.bork.bork, john@test, mary@test
238 Content-Type: text/plain
239 Subject: [issue1] Testing...
240 To: chef@bork.bork.bork, john@test, mary@test
241 From: richard <issue_tracker@fill.me.in.>
242 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.>
243 MIME-Version: 1.0
244 Message-Id: <followup_dummy_id>
245 In-Reply-To: <dummy_test_message_id>
246 X-Roundup-Name: Roundup issue tracker
247 Content-Transfer-Encoding: quoted-printable
250 richard <richard@test> added the comment:
252 This is a followup
255 ----------
256 assignedto:  -> mary
257 nosy: +mary, john
258 status: unread -> chatting
259 ___________________________________________________
260 "Roundup issue tracker" <issue_tracker@fill.me.in.>
261 http://some.useful.url/issue1
262 ___________________________________________________
263 ''')
265     def testFollowup2(self):
266         self.testNewIssue()
267         message = cStringIO.StringIO('''Content-Type: text/plain;
268   charset="iso-8859-1"
269 From: mary <mary@test>
270 To: issue_tracker@fill.me.in.
271 Message-Id: <followup_dummy_id>
272 In-Reply-To: <dummy_test_message_id>
273 Subject: [issue1] Testing...
275 This is a second followup
276 ''')
277         handler = self.instance.MailGW(self.instance, self.db)
278         handler.main(message)
279         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
280 '''FROM: roundup-admin@fill.me.in.
281 TO: chef@bork.bork.bork, richard@test
282 Content-Type: text/plain
283 Subject: [issue1] Testing...
284 To: chef@bork.bork.bork, richard@test
285 From: mary <issue_tracker@fill.me.in.>
286 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.>
287 MIME-Version: 1.0
288 Message-Id: <followup_dummy_id>
289 In-Reply-To: <dummy_test_message_id>
290 X-Roundup-Name: Roundup issue tracker
291 Content-Transfer-Encoding: quoted-printable
294 mary <mary@test> added the comment:
296 This is a second followup
299 ----------
300 status: unread -> chatting
301 ___________________________________________________
302 "Roundup issue tracker" <issue_tracker@fill.me.in.>
303 http://some.useful.url/issue1
304 ___________________________________________________
305 ''')
307     def testFollowupTitleMatch(self):
308         self.testNewIssue()
309         message = cStringIO.StringIO('''Content-Type: text/plain;
310   charset="iso-8859-1"
311 From: richard <richard@test>
312 To: issue_tracker@fill.me.in.
313 Message-Id: <followup_dummy_id>
314 In-Reply-To: <dummy_test_message_id>
315 Subject: Re: Testing... [assignedto=mary; nosy=john]
317 This is a followup
318 ''')
319         handler = self.instance.MailGW(self.instance, self.db)
320         handler.main(message)
322         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
323 '''FROM: roundup-admin@fill.me.in.
324 TO: chef@bork.bork.bork, john@test, mary@test
325 Content-Type: text/plain
326 Subject: [issue1] Testing...
327 To: chef@bork.bork.bork, john@test, mary@test
328 From: richard <issue_tracker@fill.me.in.>
329 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.>
330 MIME-Version: 1.0
331 Message-Id: <followup_dummy_id>
332 In-Reply-To: <dummy_test_message_id>
333 X-Roundup-Name: Roundup issue tracker
334 Content-Transfer-Encoding: quoted-printable
337 richard <richard@test> added the comment:
339 This is a followup
342 ----------
343 assignedto:  -> mary
344 nosy: +mary, john
345 status: unread -> chatting
346 ___________________________________________________
347 "Roundup issue tracker" <issue_tracker@fill.me.in.>
348 http://some.useful.url/issue1
349 ___________________________________________________
350 ''')
352     def testFollowupNosyAuthor(self):
353         self.testNewIssue()
354         self.instance.ADD_AUTHOR_TO_NOSY = 'yes'
355         message = cStringIO.StringIO('''Content-Type: text/plain;
356   charset="iso-8859-1"
357 From: john@test
358 To: issue_tracker@fill.me.in.
359 Message-Id: <followup_dummy_id>
360 In-Reply-To: <dummy_test_message_id>
361 Subject: [issue1] Testing...
363 This is a followup
364 ''')
365         handler = self.instance.MailGW(self.instance, self.db)
366         handler.main(message)
368         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
369 '''FROM: roundup-admin@fill.me.in.
370 TO: chef@bork.bork.bork, richard@test
371 Content-Type: text/plain
372 Subject: [issue1] Testing...
373 To: chef@bork.bork.bork, richard@test
374 From: john <issue_tracker@fill.me.in.>
375 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.>
376 MIME-Version: 1.0
377 Message-Id: <followup_dummy_id>
378 In-Reply-To: <dummy_test_message_id>
379 X-Roundup-Name: Roundup issue tracker
380 Content-Transfer-Encoding: quoted-printable
383 john <john@test> added the comment:
385 This is a followup
388 ----------
389 nosy: +john
390 status: unread -> chatting
391 ___________________________________________________
392 "Roundup issue tracker" <issue_tracker@fill.me.in.>
393 http://some.useful.url/issue1
394 ___________________________________________________
396 ''')
398     def testFollowupNosyRecipients(self):
399         self.testNewIssue()
400         self.instance.ADD_RECIPIENTS_TO_NOSY = 'yes'
401         message = cStringIO.StringIO('''Content-Type: text/plain;
402   charset="iso-8859-1"
403 From: richard@test
404 To: issue_tracker@fill.me.in.
405 Cc: john@test
406 Message-Id: <followup_dummy_id>
407 In-Reply-To: <dummy_test_message_id>
408 Subject: [issue1] Testing...
410 This is a followup
411 ''')
412         handler = self.instance.MailGW(self.instance, self.db)
413         handler.main(message)
415         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
416 '''FROM: roundup-admin@fill.me.in.
417 TO: chef@bork.bork.bork
418 Content-Type: text/plain
419 Subject: [issue1] Testing...
420 To: chef@bork.bork.bork
421 From: richard <issue_tracker@fill.me.in.>
422 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.>
423 MIME-Version: 1.0
424 Message-Id: <followup_dummy_id>
425 In-Reply-To: <dummy_test_message_id>
426 X-Roundup-Name: Roundup issue tracker
427 Content-Transfer-Encoding: quoted-printable
430 richard <richard@test> added the comment:
432 This is a followup
435 ----------
436 nosy: +john
437 status: unread -> chatting
438 ___________________________________________________
439 "Roundup issue tracker" <issue_tracker@fill.me.in.>
440 http://some.useful.url/issue1
441 ___________________________________________________
443 ''')
445     def testFollowupNosyAuthorAndCopy(self):
446         self.testNewIssue()
447         self.instance.ADD_AUTHOR_TO_NOSY = 'yes'
448         self.db.config.MESSAGES_TO_AUTHOR = 'yes'
449         message = cStringIO.StringIO('''Content-Type: text/plain;
450   charset="iso-8859-1"
451 From: john@test
452 To: issue_tracker@fill.me.in.
453 Message-Id: <followup_dummy_id>
454 In-Reply-To: <dummy_test_message_id>
455 Subject: [issue1] Testing...
457 This is a followup
458 ''')
459         handler = self.instance.MailGW(self.instance, self.db)
460         handler.main(message)
462         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
463 '''FROM: roundup-admin@fill.me.in.
464 TO: chef@bork.bork.bork, john@test, richard@test
465 Content-Type: text/plain
466 Subject: [issue1] Testing...
467 To: chef@bork.bork.bork, john@test, richard@test
468 From: john <issue_tracker@fill.me.in.>
469 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.>
470 MIME-Version: 1.0
471 Message-Id: <followup_dummy_id>
472 In-Reply-To: <dummy_test_message_id>
473 X-Roundup-Name: Roundup issue tracker
474 Content-Transfer-Encoding: quoted-printable
477 john <john@test> added the comment:
479 This is a followup
482 ----------
483 nosy: +john
484 status: unread -> chatting
485 ___________________________________________________
486 "Roundup issue tracker" <issue_tracker@fill.me.in.>
487 http://some.useful.url/issue1
488 ___________________________________________________
490 ''')
492     def testFollowupNoNosyAuthor(self):
493         self.testNewIssue()
494         self.instance.ADD_AUTHOR_TO_NOSY = 'no'
495         message = cStringIO.StringIO('''Content-Type: text/plain;
496   charset="iso-8859-1"
497 From: john@test
498 To: issue_tracker@fill.me.in.
499 Message-Id: <followup_dummy_id>
500 In-Reply-To: <dummy_test_message_id>
501 Subject: [issue1] Testing...
503 This is a followup
504 ''')
505         handler = self.instance.MailGW(self.instance, self.db)
506         handler.main(message)
508         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
509 '''FROM: roundup-admin@fill.me.in.
510 TO: chef@bork.bork.bork, richard@test
511 Content-Type: text/plain
512 Subject: [issue1] Testing...
513 To: chef@bork.bork.bork, richard@test
514 From: john <issue_tracker@fill.me.in.>
515 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.>
516 MIME-Version: 1.0
517 Message-Id: <followup_dummy_id>
518 In-Reply-To: <dummy_test_message_id>
519 X-Roundup-Name: Roundup issue tracker
520 Content-Transfer-Encoding: quoted-printable
523 john <john@test> added the comment:
525 This is a followup
528 ----------
529 status: unread -> chatting
530 ___________________________________________________
531 "Roundup issue tracker" <issue_tracker@fill.me.in.>
532 http://some.useful.url/issue1
533 ___________________________________________________
535 ''')
537     def testFollowupNoNosyRecipients(self):
538         self.testNewIssue()
539         self.instance.ADD_RECIPIENTS_TO_NOSY = 'no'
540         message = cStringIO.StringIO('''Content-Type: text/plain;
541   charset="iso-8859-1"
542 From: richard@test
543 To: issue_tracker@fill.me.in.
544 Cc: john@test
545 Message-Id: <followup_dummy_id>
546 In-Reply-To: <dummy_test_message_id>
547 Subject: [issue1] Testing...
549 This is a followup
550 ''')
551         handler = self.instance.MailGW(self.instance, self.db)
552         handler.main(message)
554         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
555 '''FROM: roundup-admin@fill.me.in.
556 TO: chef@bork.bork.bork
557 Content-Type: text/plain
558 Subject: [issue1] Testing...
559 To: chef@bork.bork.bork
560 From: richard <issue_tracker@fill.me.in.>
561 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.>
562 MIME-Version: 1.0
563 Message-Id: <followup_dummy_id>
564 In-Reply-To: <dummy_test_message_id>
565 X-Roundup-Name: Roundup issue tracker
566 Content-Transfer-Encoding: quoted-printable
569 richard <richard@test> added the comment:
571 This is a followup
574 ----------
575 status: unread -> chatting
576 ___________________________________________________
577 "Roundup issue tracker" <issue_tracker@fill.me.in.>
578 http://some.useful.url/issue1
579 ___________________________________________________
581 ''')
583     def testEnc01(self):
584         self.testNewIssue()
585         message = cStringIO.StringIO('''Content-Type: text/plain;
586   charset="iso-8859-1"
587 From: mary <mary@test>
588 To: issue_tracker@fill.me.in.
589 Message-Id: <followup_dummy_id>
590 In-Reply-To: <dummy_test_message_id>
591 Subject: [issue1] Testing...
592 Content-Type: text/plain;
593         charset="iso-8859-1"
594 Content-Transfer-Encoding: quoted-printable
596 A message with encoding (encoded oe =F6)
598 ''')
599         handler = self.instance.MailGW(self.instance, self.db)
600         handler.main(message)
601         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
602 '''FROM: roundup-admin@fill.me.in.
603 TO: chef@bork.bork.bork, richard@test
604 Content-Type: text/plain
605 Subject: [issue1] Testing...
606 To: chef@bork.bork.bork, richard@test
607 From: mary <issue_tracker@fill.me.in.>
608 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.>
609 MIME-Version: 1.0
610 Message-Id: <followup_dummy_id>
611 In-Reply-To: <dummy_test_message_id>
612 X-Roundup-Name: Roundup issue tracker
613 Content-Transfer-Encoding: quoted-printable
616 mary <mary@test> added the comment:
618 A message with encoding (encoded oe =F6)
620 ----------
621 status: unread -> chatting
622 ___________________________________________________
623 "Roundup issue tracker" <issue_tracker@fill.me.in.>
624 http://some.useful.url/issue1
625 ___________________________________________________
626 ''')
629     def testMultipartEnc01(self):
630         self.testNewIssue()
631         message = cStringIO.StringIO('''Content-Type: text/plain;
632   charset="iso-8859-1"
633 From: mary <mary@test>
634 To: issue_tracker@fill.me.in.
635 Message-Id: <followup_dummy_id>
636 In-Reply-To: <dummy_test_message_id>
637 Subject: [issue1] Testing...
638 Content-Type: multipart/mixed;
639         boundary="----_=_NextPart_000_01"
641 This message is in MIME format. Since your mail reader does not understand
642 this format, some or all of this message may not be legible.
644 ------_=_NextPart_000_01
645 Content-Type: text/plain;
646         charset="iso-8859-1"
647 Content-Transfer-Encoding: quoted-printable
649 A message with first part encoded (encoded oe =F6)
651 ''')
652         handler = self.instance.MailGW(self.instance, self.db)
653         handler.main(message)
654         self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
655 '''FROM: roundup-admin@fill.me.in.
656 TO: chef@bork.bork.bork, richard@test
657 Content-Type: text/plain
658 Subject: [issue1] Testing...
659 To: chef@bork.bork.bork, richard@test
660 From: mary <issue_tracker@fill.me.in.>
661 Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.>
662 MIME-Version: 1.0
663 Message-Id: <followup_dummy_id>
664 In-Reply-To: <dummy_test_message_id>
665 X-Roundup-Name: Roundup issue tracker
666 Content-Transfer-Encoding: quoted-printable
669 mary <mary@test> added the comment:
671 A message with first part encoded (encoded oe =F6)
673 ----------
674 status: unread -> chatting
675 ___________________________________________________
676 "Roundup issue tracker" <issue_tracker@fill.me.in.>
677 http://some.useful.url/issue1
678 ___________________________________________________
679 ''')
681 class ExtMailgwTestCase(MailgwTestCase):
682     schema = 'extended'
684 def suite():
685     l = [unittest.makeSuite(MailgwTestCase),
686          unittest.makeSuite(ExtMailgwTestCase, 'test')
687     ]
688     return unittest.TestSuite(l)
692 # $Log: not supported by cvs2svn $
693 # Revision 1.17  2002/05/02 07:56:34  richard
694 # . added option to automatically add the authors and recipients of messages
695 #   to the nosy lists with the options ADD_AUTHOR_TO_NOSY (default 'new') and
696 #   ADD_RECIPIENTS_TO_NOSY (default 'new'). These settings emulate the current
697 #   behaviour. Setting them to 'yes' will add the author/recipients to the nosy
698 #   on messages that create issues and followup messages.
699 # . added missing documentation for a few of the config option values
701 # Revision 1.16  2002/03/19 21:58:11  grubert
702 #  . for python2.1 test_mailgw compareString allows an extra trailing empty line (for quopri.
704 # Revision 1.15  2002/03/19 06:37:00  richard
705 # Made the email checking spit out a diff - much easier to spot the problem!
707 # Revision 1.14  2002/03/18 18:32:00  rochecompaan
708 # All messages sent to the nosy list are now encoded as quoted-printable.
710 # Revision 1.13  2002/02/15 07:08:45  richard
711 #  . Alternate email addresses are now available for users. See the MIGRATION
712 #    file for info on how to activate the feature.
714 # Revision 1.12  2002/02/15 00:13:38  richard
715 #  . #503204 ] mailgw needs a default class
716 #     - partially done - the setting of additional properties can wait for a
717 #       better configuration system.
719 # Revision 1.11  2002/02/14 23:38:12  richard
720 # Fixed the unit tests for the mailgw re: the x-roundup-name header.
721 # Also made the test runner more user-friendly:
722 #   ./run_tests            - detect all tests in test/test_<name>.py and run them
723 #   ./run_tests <name>     - run only test/test_<name>.py
724 # eg ./run_tests mailgw    - run the mailgw test from test/test_mailgw.py
726 # Revision 1.10  2002/02/12 08:08:55  grubert
727 #  . Clean up mail handling, multipart handling.
729 # Revision 1.9  2002/02/05 14:15:29  grubert
730 #  . respect encodings in non multipart messages.
732 # Revision 1.8  2002/02/04 09:40:21  grubert
733 #  . add test for multipart messages with first part being encoded.
735 # Revision 1.7  2002/01/22 11:54:45  rochecompaan
736 # Fixed status change in mail gateway.
738 # Revision 1.6  2002/01/21 10:05:48  rochecompaan
739 # Feature:
740 #  . the mail gateway now responds with an error message when invalid
741 #    values for arguments are specified for link or multilink properties
742 #  . modified unit test to check nosy and assignedto when specified as
743 #    arguments
745 # Fixed:
746 #  . fixed setting nosy as argument in subject line
748 # Revision 1.5  2002/01/15 00:12:40  richard
749 # #503340 ] creating issue with [asignedto=p.ohly]
751 # Revision 1.4  2002/01/14 07:12:15  richard
752 # removed file writing from tests...
754 # Revision 1.3  2002/01/14 02:20:15  richard
755 #  . changed all config accesses so they access either the instance or the
756 #    config attriubute on the db. This means that all config is obtained from
757 #    instance_config instead of the mish-mash of classes. This will make
758 #    switching to a ConfigParser setup easier too, I hope.
760 # At a minimum, this makes migration a _little_ easier (a lot easier in the
761 # 0.5.0 switch, I hope!)
763 # Revision 1.2  2002/01/11 23:22:29  richard
764 #  . #502437 ] rogue reactor and unittest
765 #    in short, the nosy reactor was modifying the nosy list. That code had
766 #    been there for a long time, and I suspsect it was there because we
767 #    weren't generating the nosy list correctly in other places of the code.
768 #    We're now doing that, so the nosy-modifying code can go away from the
769 #    nosy reactor.
771 # Revision 1.1  2002/01/02 02:31:38  richard
772 # Sorry for the huge checkin message - I was only intending to implement #496356
773 # but I found a number of places where things had been broken by transactions:
774 #  . modified ROUNDUPDBSENDMAILDEBUG to be SENDMAILDEBUG and hold a filename
775 #    for _all_ roundup-generated smtp messages to be sent to.
776 #  . the transaction cache had broken the roundupdb.Class set() reactors
777 #  . newly-created author users in the mailgw weren't being committed to the db
779 # Stuff that made it into CHANGES.txt (ie. the stuff I was actually working
780 # on when I found that stuff :):
781 #  . #496356 ] Use threading in messages
782 #  . detectors were being registered multiple times
783 #  . added tests for mailgw
784 #  . much better attaching of erroneous messages in the mail gateway
789 # vim: set filetype=python ts=4 sw=4 et si