FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.8] bpo-39793: use the same domain on make_msgid tests (GH-18698) by miss-islington · Pull Request #19554 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) .rst  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
10 changes: 6 additions & 4 deletions Lib/test/test_email/test_email.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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,9 +3342,11 @@ def test_make_msgid_idstring(self):
'.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.
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use the same domain when testing ``make_msgid``. Patch by Batuhan Taskaya.

Back | FazBrowse Home | New Git URL