Skip to content

Commit 7188252

Browse files
committed
changed _sample_headers from a map to list + tuples to allow duplicate keys
1 parent 5185956 commit 7188252

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

Lib/test/test_mailbox.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def _check_sample(self, msg):
3131
# Inspect a mailbox.Message representation of the sample message
3232
self.assertIsInstance(msg, email.message.Message)
3333
self.assertIsInstance(msg, mailbox.Message)
34-
for key, value in _sample_headers.items():
34+
for key, value in _sample_headers:
3535
self.assertIn(value, msg.get_all(key))
3636
self.assertTrue(msg.is_multipart())
3737
self.assertEqual(len(msg.get_payload()), len(_sample_payloads))
@@ -2264,30 +2264,30 @@ def test_nonempty_maildir_both(self):
22642264

22652265
_bytes_sample_message = _sample_message.encode('ascii')
22662266

2267-
_sample_headers = {
2268-
"Return-Path":"<[email protected]>",
2269-
"X-Original-To":"gkj+person@localhost",
2270-
"Delivered-To":"gkj+person@localhost",
2271-
"Received":"""from localhost (localhost [127.0.0.1])
2267+
_sample_headers = [
2268+
("Return-Path", "<[email protected]>"),
2269+
("X-Original-To", "gkj+person@localhost"),
2270+
("Delivered-To", "gkj+person@localhost"),
2271+
("Received", """from localhost (localhost [127.0.0.1])
22722272
by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17
2273-
for <gkj+person@localhost>; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)""",
2274-
"Delivered-To":"[email protected]",
2275-
"Received":"""from localhost [127.0.0.1]
2273+
for <gkj+person@localhost>; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)"""),
2274+
("Delivered-To", "[email protected]"),
2275+
("Received", """from localhost [127.0.0.1]
22762276
by localhost with POP3 (fetchmail-6.2.5)
2277-
for gkj+person@localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)""",
2278-
"Received":"""from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])
2277+
for gkj+person@localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)"""),
2278+
("Received", """from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])
22792279
by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746
2280-
for <[email protected]>; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)""",
2281-
"Received":"""by andy.gregorykjohnson.com (Postfix, from userid 1000)
2282-
id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)""",
2283-
"Date":"Wed, 13 Jul 2005 17:23:11 -0400",
2284-
"From":""""Gregory K. Johnson" <[email protected]>""",
2285-
2286-
"Subject":"Sample message",
2287-
"Mime-Version":"1.0",
2288-
"Content-Type":"""multipart/mixed; boundary="NMuMz9nt05w80d4+\"""",
2289-
"Content-Disposition":"inline",
2290-
"User-Agent": "Mutt/1.5.9i" }
2280+
for <[email protected]>; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)"""),
2281+
("Received", """by andy.gregorykjohnson.com (Postfix, from userid 1000)
2282+
id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)"""),
2283+
("Date", "Wed, 13 Jul 2005 17:23:11 -0400"),
2284+
("From", """"Gregory K. Johnson" <[email protected]>"""),
2285+
("To", "[email protected]"),
2286+
("Subject", "Sample message"),
2287+
("Mime-Version", "1.0"),
2288+
("Content-Type", """multipart/mixed; boundary="NMuMz9nt05w80d4+\""""),
2289+
("Content-Disposition", "inline"),
2290+
("User-Agent", "Mutt/1.5.9i")]
22912291

22922292
_sample_payloads = ("""This is a sample message.
22932293

0 commit comments

Comments
 (0)