Mercurial > p > roundup > code
changeset 4976:b198e50dc7dc
issued2550877 fixed, the tests adapted to the more precise header comparison. Added a hint to the code how headers are handled.
| author | Bernhard Reiter <bernhard@intevation.de> |
|---|---|
| date | Thu, 12 Mar 2015 22:11:20 +0100 |
| parents | 2fce201a2b47 |
| children | 1417dbdb8dbf |
| files | test/test_mailgw.py |
| diffstat | 1 files changed, 12 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/test/test_mailgw.py Thu Mar 12 21:56:49 2015 +0100 +++ b/test/test_mailgw.py Thu Mar 12 22:11:20 2015 +0100 @@ -57,7 +57,15 @@ class DiffHelper: def compareMessages(self, new, old): - """Compare messages for semantic equivalence.""" + """Compare messages for semantic equivalence. + + Will raise an AssertionError with a diff for inequality. + + Note that header fieldnames are case-insensitive. + So if a header fieldname appears more than once in different casing + and the values are not equal, there will be more than one entry + in the diff. Typical examples are "From:"/ "FROM:" and "TO:"/"To:". + """ new = email.message_from_string(new.strip()) old = email.message_from_string(old.strip()) @@ -458,7 +466,7 @@ ''') self.compareMessages(self._get_mail(), '''FROM: roundup-admin@your.tracker.email.domain.example -TO: chef@bork.bork.bork, mary@test.test, richard@test.test +TO: mary@test.test, richard@test.test Content-Type: text/plain; charset="utf-8" Subject: [issue1] Testing... To: mary@test.test, richard@test.test @@ -501,7 +509,7 @@ ''') self.compareMessages(self._get_mail(), '''FROM: roundup-admin@your.tracker.email.domain.example -TO: chef@bork.bork.bork, mary@test.test, richard@test.test +TO: mary@test.test, richard@test.test Content-Type: text/plain; charset="utf-8" Subject: [issue1] Testing... To: mary@test.test, richard@test.test @@ -2998,7 +3006,7 @@ assert os.path.exists(SENDMAILDEBUG) self.compareMessages(self._get_mail(), '''FROM: roundup-admin@your.tracker.email.domain.example -TO: chef@bork.bork.bork, richard@test.test +TO: richard@test.test Content-Type: text/plain; charset="utf-8" Subject: [issue1] Testing... To: richard@test.test
