Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-93121: fix test_mailbox where some test cases were accidentally dropped #93242

Merged
merged 7 commits into from Apr 6, 2023

Conversation

AGZain
Copy link
Contributor

@AGZain AGZain commented May 26, 2022

Before:

for key, value in _sample_headers.items():
self.assertIn(value, msg.get_all(key))

_sample_headers = {
"Return-Path":"<gkj@gregorykjohnson.com>",
"X-Original-To":"gkj+person@localhost",
"Delivered-To":"gkj+person@localhost",
"Received":"""from localhost (localhost [127.0.0.1])
by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17
for <gkj+person@localhost>; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)""",
"Delivered-To":"gkj@sundance.gregorykjohnson.com",
"Received":"""from localhost [127.0.0.1]
by localhost with POP3 (fetchmail-6.2.5)
for gkj+person@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@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@gregorykjohnson.com>""",
"To":"gkj@gregorykjohnson.com",
"Subject":"Sample message",
"Mime-Version":"1.0",
"Content-Type":"""multipart/mixed; boundary="NMuMz9nt05w80d4+\"""",
"Content-Disposition":"inline",
"User-Agent": "Mutt/1.5.9i" }

Since _sample_headers is a map with duplicate keys (ex: Received), not all keys are tested.

After:

Changed _sample_headers to a list of tuples so all keys are tested

@AGZain AGZain requested a review from a team as a code owner May 26, 2022 03:18
@cpython-cla-bot
Copy link

cpython-cla-bot bot commented May 26, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@bedevere-bot bedevere-bot added tests Tests in the Lib/test dir awaiting review labels May 26, 2022
Copy link
Member

@AA-Turner AA-Turner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The substantive change looks OK, two comments.

A

Lib/test/test_mailbox.py Outdated Show resolved Hide resolved
@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

blurb-it bot and others added 3 commits May 28, 2022 03:52
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@AGZain AGZain closed this May 28, 2022
@AGZain AGZain reopened this May 28, 2022
@rhettinger
Copy link
Contributor

FWIW, "map" and "mapping" are two different things.

@iritkatriel iritkatriel changed the title gh-93121: change _sample_headers from a map to list + tuples to allow duplicates gh-93121: fix test_mailbox where some test cases were accidentally dropped Apr 6, 2023
@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@iritkatriel iritkatriel merged commit a653c32 into python:main Apr 6, 2023
15 checks passed
warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants