diff options
author | Kali Kaneko <kali@leap.se> | 2015-03-23 12:59:12 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-03-30 14:48:07 -0400 |
commit | f97104e25fe504993615f194825a757d4c381a24 (patch) | |
tree | ff4a91777a7d385e5b986a2c1412e11939b76b4b /src/leap/mail/tests/test_mail.py | |
parent | efb6028e8d4096d113c565a3953919a5e30d0947 (diff) |
[bug] re-add fix for multiple headers
This fix stores as multi-line headers that are repeated, and that were
being discarded when storing them in a regular dict.
It had been removed during the last refactor.
I also store headers now as a case-insensitive dict, which solves other
problems with the implementation of the twisted imap.
Releases: 0.4.0
Diffstat (limited to 'src/leap/mail/tests/test_mail.py')
-rw-r--r-- | src/leap/mail/tests/test_mail.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/leap/mail/tests/test_mail.py b/src/leap/mail/tests/test_mail.py index d326ca8..2c03933 100644 --- a/src/leap/mail/tests/test_mail.py +++ b/src/leap/mail/tests/test_mail.py @@ -26,7 +26,7 @@ from email.parser import Parser from email.Utils import formatdate from leap.mail.adaptors.soledad import SoledadMailAdaptor -from leap.mail.mail import MessageCollection, Account +from leap.mail.mail import MessageCollection, Account, _unpack_headers from leap.mail.mailbox_indexer import MailboxIndexer from leap.mail.tests.common import SoledadTestMixin @@ -144,8 +144,10 @@ class MessageTestCase(SoledadTestMixin, CollectionMixin): def _test_get_headers_cb(self, msg): self.assertTrue(msg is not None) - expected = _get_parsed_msg().items() - self.assertEqual(msg.get_headers(), expected) + expected = [ + (str(key.lower()), str(value)) + for (key, value) in _get_parsed_msg().items()] + self.assertItemsEqual(_unpack_headers(msg.get_headers()), expected) def test_get_body_file(self): d = self.get_inserted_msg(multi=True) |