Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eae36ac

Browse files
committed
test_parseaddr_empty(): New test for assuring that
Utils.parseaddr('<>') -- i.e. on an empty address, returns the empty string. Built on rfc822, this used to return None.
1 parent 5e08d10 commit eae36ac

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Lib/test/test_email.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,10 @@ def test_formatdate_localtime(self):
952952
def test_parsedate_none(self):
953953
self.assertEqual(Utils.parsedate(''), None)
954954

955+
def test_parseaddr_empty(self):
956+
self.assertEqual(Utils.parseaddr('<>'), ('', ''))
957+
self.assertEqual(Utils.dump_address_pair(Utils.parseaddr('<>')), '')
958+
955959

956960

957961
# Test the iterator/generators

0 commit comments

Comments
 (0)