Merge #28407 Improve test coverage of make_msgid.

This commit is contained in:
R David Murray 2016-12-17 22:04:48 -05:00
commit 3e8d9413eb
2 changed files with 13 additions and 0 deletions

View File

@ -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:
@ -3314,6 +3315,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:

View File

@ -189,6 +189,7 @@ Tom Bridgman
Anthony Briggs
Keith Briggs
Tobias Brink
Dillon Brock
Richard Brodie
Michael Broghton
Ammar Brohi