Skip to content

Commit 7df079b

Browse files
authored
Merge pull request #1 from hugovk/emails-test
Add test
2 parents 3ec03a7 + 2c57529 commit 7df079b

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

pep_sphinx_extensions/tests/pep_zero_generator/test_writer.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,23 @@ def test_verify_email_addresses(test_input, expected):
5656
assert out == expected
5757

5858

59+
def test_verify_email_addresses_multiple_emails():
60+
# Arrange
61+
peps = [
62+
parser.PEP(Path("pep_sphinx_extensions/tests/peps/pep-9000.rst")),
63+
parser.PEP(Path("pep_sphinx_extensions/tests/peps/pep-9003.rst")),
64+
]
65+
66+
# Act
67+
out = writer._verify_email_addresses(peps)
68+
69+
# Assert: Francis has two emails combined, Javier's single email is not duplicated
70+
assert out == {
71+
"Francis Fussyreverend": "one@example.com, different@example.com",
72+
"Javier Soulfulcommodore": "two@example.com",
73+
}
74+
75+
5976
def test_sort_authors():
6077
# Arrange
6178
authors_dict = {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
PEP: 9003
2+
Title: Test with author using a different email than in PEP 9000
3+
Author: Francis Fussyreverend <different@example.com>,
4+
Javier Soulfulcommodore <two@example.com>
5+
Created: 20-Apr-2022
6+
Status: Draft
7+
Type: Process

0 commit comments

Comments
 (0)