Commit c69fd86f authored by R David Murray's avatar R David Murray

#28407 Improve test coverage of make_msgid.

Patch by Dillon Brock.
parent 58667195
...@@ -11,6 +11,7 @@ import textwrap ...@@ -11,6 +11,7 @@ import textwrap
from io import StringIO, BytesIO from io import StringIO, BytesIO
from itertools import chain from itertools import chain
from random import choice from random import choice
from socket import getfqdn
try: try:
from threading import Thread from threading import Thread
except ImportError: except ImportError:
...@@ -3294,6 +3295,17 @@ multipart/report ...@@ -3294,6 +3295,17 @@ multipart/report
email.utils.make_msgid(domain='testdomain-string')[-19:], email.utils.make_msgid(domain='testdomain-string')[-19:],
'@testdomain-string>') '@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): def test_Generator_linend(self):
# Issue 14645. # Issue 14645.
with openfile('msg_26.txt', newline='\n') as f: with openfile('msg_26.txt', newline='\n') as f:
......
...@@ -187,6 +187,7 @@ Tom Bridgman ...@@ -187,6 +187,7 @@ Tom Bridgman
Anthony Briggs Anthony Briggs
Keith Briggs Keith Briggs
Tobias Brink Tobias Brink
Dillon Brock
Richard Brodie Richard Brodie
Michael Broghton Michael Broghton
Ammar Brohi Ammar Brohi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment