[Python-checkins] gh-93121: fix test_mailbox where some test cases were accidentally dropped (#93242)
iritkatriel
webhook-mailer at python.org
Thu Apr 6 18:19:19 EDT 2023
https://github.com/python/cpython/commit/a653c32d08abfa34d70186542479e3a7e704f8bd
commit: a653c32d08abfa34d70186542479e3a7e704f8bd
branch: main
author: AGZain <31054801+AGZain at users.noreply.github.com>
committer: iritkatriel <1055913+iritkatriel at users.noreply.github.com>
date: 2023-04-06T23:19:11+01:00
summary:
gh-93121: fix test_mailbox where some test cases were accidentally dropped (#93242)
files:
M Lib/test/test_mailbox.py
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
index 07c2764dfd1b..4c592eaf34da 100644
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -31,7 +31,7 @@ def _check_sample(self, msg):
# Inspect a mailbox.Message representation of the sample message
self.assertIsInstance(msg, email.message.Message)
self.assertIsInstance(msg, mailbox.Message)
- for key, value in _sample_headers.items():
+ for key, value in _sample_headers:
self.assertIn(value, msg.get_all(key))
self.assertTrue(msg.is_multipart())
self.assertEqual(len(msg.get_payload()), len(_sample_payloads))
@@ -2264,30 +2264,31 @@ def test_nonempty_maildir_both(self):
_bytes_sample_message = _sample_message.encode('ascii')
-_sample_headers = {
- "Return-Path":"<gkj at gregorykjohnson.com>",
- "X-Original-To":"gkj+person at localhost",
- "Delivered-To":"gkj+person at localhost",
- "Received":"""from localhost (localhost [127.0.0.1])
+_sample_headers = [
+ ("Return-Path", "<gkj at gregorykjohnson.com>"),
+ ("X-Original-To", "gkj+person at localhost"),
+ ("Delivered-To", "gkj+person at localhost"),
+ ("Received", """from localhost (localhost [127.0.0.1])
by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17
- for <gkj+person at localhost>; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)""",
- "Delivered-To":"gkj at sundance.gregorykjohnson.com",
- "Received":"""from localhost [127.0.0.1]
+ for <gkj+person at localhost>; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)"""),
+ ("Delivered-To", "gkj at sundance.gregorykjohnson.com"),
+ ("Received", """from localhost [127.0.0.1]
by localhost with POP3 (fetchmail-6.2.5)
- for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)""",
- "Received":"""from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])
+ for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)"""),
+ ("Received", """from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])
by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746
- for <gkj at gregorykjohnson.com>; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)""",
- "Received":"""by andy.gregorykjohnson.com (Postfix, from userid 1000)
- id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)""",
- "Date":"Wed, 13 Jul 2005 17:23:11 -0400",
- "From":""""Gregory K. Johnson" <gkj at gregorykjohnson.com>""",
- "To":"gkj at gregorykjohnson.com",
- "Subject":"Sample message",
- "Mime-Version":"1.0",
- "Content-Type":"""multipart/mixed; boundary="NMuMz9nt05w80d4+\"""",
- "Content-Disposition":"inline",
- "User-Agent": "Mutt/1.5.9i" }
+ for <gkj at gregorykjohnson.com>; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)"""),
+ ("Received", """by andy.gregorykjohnson.com (Postfix, from userid 1000)
+ id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)"""),
+ ("Date", "Wed, 13 Jul 2005 17:23:11 -0400"),
+ ("From", """"Gregory K. Johnson" <gkj at gregorykjohnson.com>"""),
+ ("To", "gkj at gregorykjohnson.com"),
+ ("Subject", "Sample message"),
+ ("Mime-Version", "1.0"),
+ ("Content-Type", """multipart/mixed; boundary="NMuMz9nt05w80d4+\""""),
+ ("Content-Disposition", "inline"),
+ ("User-Agent", "Mutt/1.5.9i"),
+]
_sample_payloads = ("""This is a sample message.
More information about the Python-checkins
mailing list