Skip to content

Commit d4f8132

Browse files
committed
Merge #28407 Improve test coverage of make_msgid.
2 parents 40fa266 + c69fd86 commit d4f8132

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

Lib/test/test_email/test_email.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from io import StringIO, BytesIO
1212
from itertools import chain
1313
from random import choice
14+
from socket import getfqdn
1415
try:
1516
from threading import Thread
1617
except ImportError:
@@ -3314,6 +3315,17 @@ def test_make_msgid_domain(self):
33143315
email.utils.make_msgid(domain='testdomain-string')[-19:],
33153316
'@testdomain-string>')
33163317

3318+
def test_make_msgid_idstring(self):
3319+
self.assertEqual(
3320+
email.utils.make_msgid(idstring='test-idstring',
3321+
domain='testdomain-string')[-33:],
3322+
'.test-idstring@testdomain-string>')
3323+
3324+
def test_make_msgid_default_domain(self):
3325+
self.assertTrue(
3326+
email.utils.make_msgid().endswith(
3327+
'@' + getfqdn() + '>'))
3328+
33173329
def test_Generator_linend(self):
33183330
# Issue 14645.
33193331
with openfile('msg_26.txt', newline='\n') as f:

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ Tom Bridgman
189189
Anthony Briggs
190190
Keith Briggs
191191
Tobias Brink
192+
Dillon Brock
192193
Richard Brodie
193194
Michael Broghton
194195
Ammar Brohi

0 commit comments

Comments
 (0)