Better automated test to help roundup Issue2550869 against rev4964:2c3cc4ccd024. Now it is continuation lines- and case-sensitive when comparing emails. bernhard@intevation.de diff -r 2c3cc4ccd024 test/test_mailgw.py --- a/test/test_mailgw.py Mon Feb 16 17:43:58 2015 +0100 +++ b/test/test_mailgw.py Wed Feb 25 23:58:16 2015 +0100 @@ -86,9 +86,16 @@ oldmime = old.get(key, '').split('=',1)[-1].strip('"') replace ['--' + newmime] = '--' + oldmime replace ['--' + newmime + '--'] = '--' + oldmime + '--' - elif new.get(key, '') != old.get(key, ''): - res.append(' %s: %r != %r' % (key, old.get(key, ''), - new.get(key, ''))) + else: + # check that all other headers are identical, including + # headers that appear more than once. So using get(key, '') + # is not enough and the rfc822 module's best offer is + # getallmatchingheaders() which does not do full parsing of + # continuation lines, but at least tests all appearances. + newhs = new.getallmatchingheaders(key) + oldhs = old.getallmatchingheaders(key) + if newhs != oldhs: + res.append(' %s: %r != %r' % (key, newhs, oldhs)) body_diff = self.compareStrings(new.fp.read(), old.fp.read(), replace=replace) @@ -414,7 +421,7 @@ Message-Id: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: unread +X-Roundup-issue-status: unread Content-Transfer-Encoding: quoted-printable @@ -460,7 +467,7 @@ Message-Id: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: unread +X-Roundup-issue-status: unread Content-Transfer-Encoding: quoted-printable This is a test submission of a new issue. @@ -503,7 +510,7 @@ Message-Id: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: unread +X-Roundup-issue-status: unread Content-Transfer-Encoding: quoted-printable New submission from Bork, Chef: @@ -786,7 +793,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting X-Roundup-Issue-Files: unnamed Content-Transfer-Encoding: quoted-printable @@ -837,7 +844,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting X-Roundup-Issue-Files: unnamed Content-Transfer-Encoding: quoted-printable @@ -886,7 +893,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting X-Roundup-Issue-Files: unnamed Content-Transfer-Encoding: quoted-printable @@ -950,7 +957,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting X-Roundup-Issue-Files: unnamed Content-Transfer-Encoding: quoted-printable @@ -1009,7 +1016,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting X-Roundup-Issue-Files: Fwd: Original email subject.eml Content-Transfer-Encoding: quoted-printable @@ -1109,7 +1116,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting Content-Transfer-Encoding: quoted-printable @@ -1158,7 +1165,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting Content-Transfer-Encoding: quoted-printable @@ -1210,7 +1217,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting Content-Transfer-Encoding: quoted-printable richard added the comment: @@ -1265,7 +1272,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting Content-Transfer-Encoding: quoted-printable richard added the comment: @@ -1312,7 +1319,7 @@ Message-Id: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: unread +X-Roundup-issue-status: unread Content-Transfer-Encoding: quoted-printable @@ -1363,7 +1370,7 @@ From: "Bork, Chef" X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: unread +X-Roundup-issue-status: unread X-Roundup-Version: 1.3.3 In-Reply-To: MIME-Version: 1.0 @@ -1417,7 +1424,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting Content-Transfer-Encoding: quoted-printable @@ -1531,7 +1538,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting Content-Transfer-Encoding: quoted-printable @@ -1578,7 +1585,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting Content-Transfer-Encoding: quoted-printable @@ -1616,7 +1623,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting Content-Transfer-Encoding: quoted-printable @@ -1654,7 +1661,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting Content-Transfer-Encoding: quoted-printable @@ -1691,7 +1698,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting Content-Transfer-Encoding: quoted-printable @@ -1728,7 +1735,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting Content-Transfer-Encoding: quoted-printable @@ -1767,7 +1774,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting Content-Transfer-Encoding: quoted-printable @@ -1813,7 +1820,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting Content-Transfer-Encoding: quoted-printable @@ -2117,7 +2124,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting Content-Transfer-Encoding: quoted-printable @@ -2166,7 +2173,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting Content-Transfer-Encoding: quoted-printable @@ -2221,7 +2228,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting Content-Transfer-Encoding: quoted-printable @@ -2299,7 +2306,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting Content-Transfer-Encoding: quoted-printable @@ -3001,7 +3008,7 @@ In-Reply-To: X-Roundup-Name: Roundup issue tracker X-Roundup-Loop: hello -X-Roundup-Issue-Status: chatting +X-Roundup-issue-status: chatting Content-Transfer-Encoding: quoted-printable