OLD | NEW |
| (Empty) |
1 # Copyright (c) 2001-2004 Twisted Matrix Laboratories. | |
2 # See LICENSE for details. | |
3 | |
4 | |
5 """Test cases for bounce message generation | |
6 """ | |
7 | |
8 from twisted.trial import unittest | |
9 from twisted.mail import bounce | |
10 import rfc822, cStringIO | |
11 | |
12 class BounceTestCase(unittest.TestCase): | |
13 """ | |
14 testcases for bounce message generation | |
15 """ | |
16 | |
17 def testBounceFormat(self): | |
18 from_, to, s = bounce.generateBounce(cStringIO.StringIO('''\ | |
19 From: Moshe Zadka <moshez@example.com> | |
20 To: nonexistant@example.org | |
21 Subject: test | |
22 | |
23 '''), 'moshez@example.com', 'nonexistant@example.org') | |
24 self.assertEquals(from_, '') | |
25 self.assertEquals(to, 'moshez@example.com') | |
26 mess = rfc822.Message(cStringIO.StringIO(s)) | |
27 self.assertEquals(mess['To'], 'moshez@example.com') | |
28 self.assertEquals(mess['From'], 'postmaster@example.org') | |
29 self.assertEquals(mess['subject'], 'Returned Mail: see transcript for de
tails') | |
30 | |
31 def testBounceMIME(self): | |
32 pass | |
OLD | NEW |