]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
test_parseaddr_empty(): New test for assuring that
authorBarry Warsaw <barry@python.org>
Thu, 20 Dec 2001 16:37:27 +0000 (16:37 +0000)
committerBarry Warsaw <barry@python.org>
Thu, 20 Dec 2001 16:37:27 +0000 (16:37 +0000)
Utils.parseaddr('<>') -- i.e. on an empty address, returns the empty
string.  Built on rfc822, this used to return None.

Lib/test/test_email.py

index ddc36f37a7d90e17310ce708f94584db83e12f6a..5be7e95d9a9d044129942a23a2ff320f6006d049 100644 (file)
@@ -952,6 +952,10 @@ class TestMiscellaneous(unittest.TestCase):
     def test_parsedate_none(self):
         self.assertEqual(Utils.parsedate(''), None)
 
+    def test_parseaddr_empty(self):
+        self.assertEqual(Utils.parseaddr('<>'), ('', ''))
+        self.assertEqual(Utils.dump_address_pair(Utils.parseaddr('<>')), '')
+
 
 \f
 # Test the iterator/generators