comparison test/test_mailgw.py @ 5152:65b42fd96c00

partly test subject line of 'help' to trigger help message. Can't verify the help message is sent though
author John Rouillard <rouilj@ieee.org>
date Wed, 20 Jul 2016 21:35:55 -0400
parents 6bbb6dd97458
children 198b6e810c67
comparison
equal deleted inserted replaced
5151:6bbb6dd97458 5152:65b42fd96c00
250 f = open(SENDMAILDEBUG) 250 f = open(SENDMAILDEBUG)
251 try: 251 try:
252 return f.read() 252 return f.read()
253 finally: 253 finally:
254 f.close() 254 f.close()
255
256 def testHelpMessage(self):
257 help_message='''Content-Type: text/plain;
258 charset="iso-8859-1"
259 From: Chef <chef@bork.bork.bork>
260 To: issue_tracker@your.tracker.email.domain.example
261 Cc: richard@test.test
262 Reply-To: chef@bork.bork.bork
263 Message-Id: <dummy_test_message_id>
264 Subject: help
265
266 '''
267 assert not os.path.exists(SENDMAILDEBUG)
268 self.assertRaises(MailUsageHelp, self._handle_mail, help_message)
269 # FIXME I think help sends email. but using _get_mail() doesn't
270 # work. The file mail-test.log is missing.
271 # self.compareMessages(self._get_mail(), 1)
272
255 273
256 # Normal test-case used for both non-pgp test and a test while pgp 274 # Normal test-case used for both non-pgp test and a test while pgp
257 # is enabled, so this test is run in both test suites. 275 # is enabled, so this test is run in both test suites.
258 def testEmptyMessage(self): 276 def testEmptyMessage(self):
259 nodeid = self._handle_mail('''Content-Type: text/plain; 277 nodeid = self._handle_mail('''Content-Type: text/plain;

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