-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
49 additions
and
42 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
from email.utils import getaddresses, parseaddr | ||
import logging | ||
import re | ||
import sys | ||
|
@@ -14,7 +13,7 @@ | |
from unittest import main, TestCase, mock | ||
|
||
from envelope import Envelope | ||
from envelope.address import Address | ||
from envelope.address import Address, _parseaddr, _getaddresses | ||
from envelope.constants import AUTO, PLAIN, HTML | ||
from envelope.parser import Parser | ||
from envelope.smtp_handler import SMTPHandler | ||
|
@@ -1245,11 +1244,11 @@ def test_disguised_addresses(self): | |
# https://github.com/python/cpython/issues/40889#issuecomment-1094001067 | ||
disguise_addr = "[email protected] <[email protected]>" | ||
same = "[email protected] <[email protected]>" | ||
self.assertEqual(('', '[email protected]'), parseaddr(disguise_addr)) | ||
self.assertEqual(('', '[email protected]'), _parseaddr(disguise_addr)) | ||
self.assertEqual([('', '[email protected]'), ('', '[email protected]')], | ||
getaddresses([disguise_addr])) | ||
_getaddresses([disguise_addr])) | ||
self.assertEqual([('', '[email protected]'), ('', '[email protected]')], | ||
getaddresses([same])) | ||
_getaddresses([same])) | ||
|
||
# For the same input, Envelope receives better results. | ||
self.assertEqual(Address(name='[email protected]', address='[email protected]'), Address(disguise_addr)) | ||
|