[Python-checkins] cpython (merge 3.6 -> default): Merge #28407 Improve test coverage of make_msgid.
r.david.murray
python-checkins at python.org
Sat Dec 17 22:05:49 EST 2016
https://hg.python.org/cpython/rev/c016ab381894
changeset: 105720:c016ab381894
parent: 105717:3014854e68e4
parent: 105719:87671b1f7ff4
user: R David Murray <rdmurray at bitdance.com>
date: Sat Dec 17 22:04:48 2016 -0500
summary:
Merge #28407 Improve test coverage of make_msgid.
files:
Lib/test/test_email/test_email.py | 12 ++++++++++++
Misc/ACKS | 1 +
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
--- a/Lib/test/test_email/test_email.py
+++ b/Lib/test/test_email/test_email.py
@@ -11,6 +11,7 @@
from io import StringIO, BytesIO
from itertools import chain
from random import choice
+from socket import getfqdn
try:
from threading import Thread
except ImportError:
@@ -3314,6 +3315,17 @@
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 at 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
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -189,6 +189,7 @@
Anthony Briggs
Keith Briggs
Tobias Brink
+Dillon Brock
Richard Brodie
Michael Broghton
Ammar Brohi
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list