summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_email
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-07-19 16:54:45 (GMT)
committerGitHub <noreply@github.com>2021-07-19 16:54:45 (GMT)
commit8c43bf1a923754fa6d97772151c6ac23c48759d3 (patch)
tree2b735fcf283a48f20d543e1b5989d92ccdaa0d1d /Lib/test/test_email
parent2d0492091e3fce73230b2e88949210c9f1eb194b (diff)
downloadcpython-8c43bf1a923754fa6d97772151c6ac23c48759d3.zip
cpython-8c43bf1a923754fa6d97772151c6ac23c48759d3.tar.gz
cpython-8c43bf1a923754fa6d97772151c6ac23c48759d3.tar.bz2
bpo-27513: email.utils.getaddresses() now handles Header objects (GH-13797) (GH-27242)
getaddresses() should be able to handle a Header object if passed one. Co-authored-by: Ɓukasz Langa <lukasz@langa.pl> (cherry picked from commit 89f4c34797de2f0e5045da2b97c1c8cbbb42fbb2) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Diffstat (limited to 'Lib/test/test_email')
-rw-r--r--Lib/test/test_email/test_email.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py
index eed6014..0154bba 100644
--- a/Lib/test/test_email/test_email.py
+++ b/Lib/test/test_email/test_email.py
@@ -3263,6 +3263,11 @@ Foo
addrs = utils.getaddresses(['User ((nested comment)) <foo@bar.com>'])
eq(addrs[0][1], 'foo@bar.com')
+ def test_getaddresses_header_obj(self):
+ """Test the handling of a Header object."""
+ addrs = utils.getaddresses([Header('Al Person <aperson@dom.ain>')])
+ self.assertEqual(addrs[0][1], 'aperson@dom.ain')
+
def test_make_msgid_collisions(self):
# Test make_msgid uniqueness, even with multiple threads
class MsgidsThread(Thread):