comparison test/test_mailgw.py @ 3368:246fed02a51e maint-0.8

merge from HEAD
author Richard Jones <richard@users.sourceforge.net>
date Fri, 24 Jun 2005 06:48:17 +0000
parents f412ae175b4d
children b854a6a08fff
comparison
equal deleted inserted replaced
3366:985ba73ca6ad 3368:246fed02a51e
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.73.2.1 2005-02-14 05:55:20 richard Exp $ 11 # $Id: test_mailgw.py,v 1.73.2.2 2005-06-24 06:48:17 richard Exp $
12 12
13 # TODO: test bcc 13 # TODO: test bcc
14 14
15 import unittest, tempfile, os, shutil, errno, imp, sys, difflib, rfc822 15 import unittest, tempfile, os, shutil, errno, imp, sys, difflib, rfc822
16 16
19 if not os.environ.has_key('SENDMAILDEBUG'): 19 if not os.environ.has_key('SENDMAILDEBUG'):
20 os.environ['SENDMAILDEBUG'] = 'mail-test.log' 20 os.environ['SENDMAILDEBUG'] = 'mail-test.log'
21 SENDMAILDEBUG = os.environ['SENDMAILDEBUG'] 21 SENDMAILDEBUG = os.environ['SENDMAILDEBUG']
22 22
23 from roundup.mailgw import MailGW, Unauthorized, uidFromAddress, \ 23 from roundup.mailgw import MailGW, Unauthorized, uidFromAddress, \
24 parseContent, IgnoreLoop, IgnoreBulk 24 parseContent, IgnoreLoop, IgnoreBulk, MailUsageError
25 from roundup import init, instance, password, rfc2822, __version__ 25 from roundup import init, instance, password, rfc2822, __version__
26 26
27 import db_test_base 27 import db_test_base
28 28
29 class Message(rfc822.Message): 29 class Message(rfc822.Message):
1018 Subject: Re: [issue] Out of office AutoReply: Back next week 1018 Subject: Re: [issue] Out of office AutoReply: Back next week
1019 1019
1020 Hi, I'm back in the office next week 1020 Hi, I'm back in the office next week
1021 ''') 1021 ''')
1022 1022
1023 def testNoSubject(self):
1024 self.assertRaises(MailUsageError, self._handle_mail,
1025 '''Content-Type: text/plain;
1026 charset="iso-8859-1"
1027 From: Chef <chef@bork.bork.bork>
1028 To: issue_tracker@your.tracker.email.domain.example
1029 Cc: richard@test
1030 Reply-To: chef@bork.bork.bork
1031 Message-Id: <dummy_test_message_id>
1032
1033 ''')
1034
1023 def test_suite(): 1035 def test_suite():
1024 suite = unittest.TestSuite() 1036 suite = unittest.TestSuite()
1025 suite.addTest(unittest.makeSuite(MailgwTestCase)) 1037 suite.addTest(unittest.makeSuite(MailgwTestCase))
1026 return suite 1038 return suite
1027 1039

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