Skip to content

Commit a23a8c9

Browse files
issue2550877 partly fixed.
* Added docstring hint to _get_mail(). * Fixed FROM: lines in testMultipartRFC822() and testUnknownUser()
1 parent 5d04db0 commit a23a8c9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/test_mailgw.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,11 @@ def _handle_mail(self, message, args=(), trap_exc=0):
198198
return handler.main(StringIO(message))
199199

200200
def _get_mail(self):
201+
"""Reads an email that has been written to file via debug output.
202+
203+
Note: the resulting email will have three leading extra lines
204+
written by the self.debug code branch in Mailer.smtp_send().
205+
"""
201206
f = open(SENDMAILDEBUG)
202207
try:
203208
return f.read()
@@ -1001,7 +1006,8 @@ def testMultipartRFC822(self):
10011006
self.assertEqual(f.name, name)
10021007
self.assertEqual(msg.content, 'First part: Text')
10031008
self.compareMessages(self._get_mail(),
1004-
1009+
1010+
10051011
Content-Type: text/plain; charset="utf-8"
10061012
Subject: [issue1] Testing...
10071013
@@ -2040,7 +2046,7 @@ def testUnknownUser(self):
20402046
# trap_exc=1: we want a bounce message:
20412047
ret = self._handle_mail(message, trap_exc=1)
20422048
self.compareMessages(self._get_mail(),
2043-
'''FROM: Roundup issue tracker <[email protected]>
2049+
20442050
20452051
From nobody Tue Jul 14 12:04:11 2009
20462052
Content-Type: multipart/mixed; boundary="===============0639262320=="

0 commit comments

Comments
 (0)