mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
bpo-39793: use the same domain on make_msgid tests (#18698)
* bpo-39793: use same domain on make_msgid tests * apply suggestions
This commit is contained in:
parent
70f027dd22
commit
5565c30f0b
2 changed files with 7 additions and 4 deletions
|
|
@ -11,8 +11,8 @@ import textwrap
|
|||
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
|
||||
|
|
@ -3342,9 +3342,11 @@ multipart/report
|
|||
'.test-idstring@testdomain-string>')
|
||||
|
||||
def test_make_msgid_default_domain(self):
|
||||
self.assertTrue(
|
||||
email.utils.make_msgid().endswith(
|
||||
'@' + getfqdn() + '>'))
|
||||
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.
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
Use the same domain when testing ``make_msgid``. Patch by Batuhan Taskaya.
|
||||
Loading…
Add table
Add a link
Reference in a new issue