summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2016-12-18 03:03:44 (GMT)
committerR David Murray <rdmurray@bitdance.com>2016-12-18 03:03:44 (GMT)
commitc69fd86f94365a4d502765c2618d0df7e9d7ae67 (patch)
treecd4e405c02065537974e0cfe5bc35793b4557091
parent5866719510b68a77833323f6dc0dda72b00a38fa (diff)
downloadcpython-c69fd86f94365a4d502765c2618d0df7e9d7ae67.zip
cpython-c69fd86f94365a4d502765c2618d0df7e9d7ae67.tar.gz
cpython-c69fd86f94365a4d502765c2618d0df7e9d7ae67.tar.bz2
#28407 Improve test coverage of make_msgid.
Patch by Dillon Brock.
-rw-r--r--Lib/test/test_email/test_email.py12
-rw-r--r--Misc/ACKS1
2 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py
index a53cc9b..9b86a2a 100644
--- a/Lib/test/test_email/test_email.py
+++ b/Lib/test/test_email/test_email.py
@@ -11,6 +11,7 @@ import textwrap
from io import StringIO, BytesIO
from itertools import chain
from random import choice
+from socket import getfqdn
try:
from threading import Thread
except ImportError:
@@ -3294,6 +3295,17 @@ multipart/report
email.utils.make_msgid(domain='testdomain-string')[-19:],
'@testdomain-string>')
+ def test_make_msgid_idstring(self):
+ self.assertEqual(
+ email.utils.make_msgid(idstring='test-idstring',
+ domain='testdomain-string')[-33:],
+ '.test-idstring@testdomain-string>')
+
+ def test_make_msgid_default_domain(self):
+ self.assertTrue(
+ email.utils.make_msgid().endswith(
+ '@' + getfqdn() + '>'))
+
def test_Generator_linend(self):
# Issue 14645.
with openfile('msg_26.txt', newline='\n') as f:
diff --git a/Misc/ACKS b/Misc/ACKS
index 08d06e7..a9cd72e 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -187,6 +187,7 @@ Tom Bridgman
Anthony Briggs
Keith Briggs
Tobias Brink
+Dillon Brock
Richard Brodie
Michael Broghton
Ammar Brohi