mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
parseaddr(): Fixed in the same way that Message.getaddrlist() was
fixed (re: SF bug #555035). Include a unittest.
This commit is contained in:
parent
12424bc0ef
commit
f655328483
2 changed files with 10 additions and 1 deletions
|
@ -213,6 +213,15 @@ A test message.
|
|||
addrs.sort()
|
||||
eq(addrs, ccs)
|
||||
|
||||
def test_parseaddr(self):
|
||||
eq = self.assertEqual
|
||||
eq(rfc822.parseaddr('<>'), ('', ''))
|
||||
eq(rfc822.parseaddr('aperson@dom.ain'), ('', 'aperson@dom.ain'))
|
||||
eq(rfc822.parseaddr('bperson@dom.ain (Bea A. Person)'),
|
||||
('Bea A. Person', 'bperson@dom.ain'))
|
||||
eq(rfc822.parseaddr('Cynthia Person <cperson@dom.ain>'),
|
||||
('Cynthia Person', 'cperson@dom.ain'))
|
||||
|
||||
def test_main():
|
||||
test_support.run_unittest(MessageTestCase)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue