diff options
| author | R David Murray <rdmurray@bitdance.com> | 2016-12-18 03:04:48 (GMT) |
|---|---|---|
| committer | R David Murray <rdmurray@bitdance.com> | 2016-12-18 03:04:48 (GMT) |
| commit | 3e8d9413eb6b5126de3181c30ed3edea399d4934 (patch) | |
| tree | af0ff05941f5c62d9c0d2b1de9f07a50a2516431 /Lib/test | |
| parent | bbc587742719492168d250f3dcd53d82defaa0a9 (diff) | |
| parent | d4f813227891dfd1725bf330b0a25a477c8e16ac (diff) | |
| download | cpython-3e8d9413eb6b5126de3181c30ed3edea399d4934.zip cpython-3e8d9413eb6b5126de3181c30ed3edea399d4934.tar.gz cpython-3e8d9413eb6b5126de3181c30ed3edea399d4934.tar.bz2 | |
Merge #28407 Improve test coverage of make_msgid.
Diffstat (limited to 'Lib/test')
| -rw-r--r-- | Lib/test/test_email/test_email.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py index daa1285..f97ccc6 100644 --- a/Lib/test/test_email/test_email.py +++ b/Lib/test/test_email/test_email.py @@ -11,6 +11,7 @@ import textwrap from io import StringIO, BytesIO from itertools import chain from random import choice +from socket import getfqdn try: from threading import Thread except ImportError: @@ -3314,6 +3315,17 @@ multipart/report email.utils.make_msgid(domain='testdomain-string')[-19:], '@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): # Issue 14645. with openfile('msg_26.txt', newline='\n') as f: |
