Skip to content

Commit aa5737e

Browse files
issued2550877 fixed, the tests adapted to the more precise header comparison. Added a hint to the code how headers are handled.
1 parent a1f6e47 commit aa5737e

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

test/test_mailgw.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,15 @@ def open(self, journaltag):
5757

5858
class DiffHelper:
5959
def compareMessages(self, new, old):
60-
"""Compare messages for semantic equivalence."""
60+
"""Compare messages for semantic equivalence.
61+
62+
Will raise an AssertionError with a diff for inequality.
63+
64+
Note that header fieldnames are case-insensitive.
65+
So if a header fieldname appears more than once in different casing
66+
and the values are not equal, there will be more than one entry
67+
in the diff. Typical examples are "From:"/ "FROM:" and "TO:"/"To:".
68+
"""
6169
new = email.message_from_string(new.strip())
6270
old = email.message_from_string(old.strip())
6371

@@ -458,7 +466,7 @@ def testNewIssueNoAuthorInfo(self):
458466
''')
459467
self.compareMessages(self._get_mail(),
460468
461-
469+
462470
Content-Type: text/plain; charset="utf-8"
463471
Subject: [issue1] Testing...
464472
@@ -501,7 +509,7 @@ def testNewIssueNoAuthorEmail(self):
501509
''')
502510
self.compareMessages(self._get_mail(),
503511
504-
512+
505513
Content-Type: text/plain; charset="utf-8"
506514
Subject: [issue1] Testing...
507515
@@ -2998,7 +3006,7 @@ def testSecurityMessagePermissionContent(self):
29983006
assert os.path.exists(SENDMAILDEBUG)
29993007
self.compareMessages(self._get_mail(),
30003008
3001-
3009+
30023010
Content-Type: text/plain; charset="utf-8"
30033011
Subject: [issue1] Testing...
30043012

0 commit comments

Comments
 (0)