Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
apply suggestions
  • Loading branch information
isidentical committed Mar 5, 2020
commit 50ddd37533ffdd83cb4c0123025b3d0616389988
11 changes: 6 additions & 5 deletions Lib/test/test_email/test_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from io import StringIO, BytesIO
from itertools import chain
from random import choice
from socket import getfqdn
from threading import Thread
from unittest.mock import patch

import email
import email.policy
Expand Down Expand Up @@ -3342,10 +3342,11 @@ def test_make_msgid_idstring(self):
'.test-idstring@testdomain-string>')

def test_make_msgid_default_domain(self):
Comment thread
akuchling marked this conversation as resolved.
domain = getfqdn() # ensure the domain wont change (bpo-39793)
self.assertTrue(
email.utils.make_msgid(domain=domain).endswith(
'@' + domain + '>'))
with patch('socket.getfqdn') as mock_getfqdn:
mock_getfqdn.return_value = domain = 'pythontest.example.com'
self.assertTrue(
email.utils.make_msgid().endswith(
'@' + domain + '>'))

def test_Generator_linend(self):
# Issue 14645.
Expand Down