Move expected failure to testutils.py where it can be tagged.

Change to example.com/40 for iniplist with leftover bits to ignore.
This commit is contained in:
Stuart D. Gathman
2016-10-17 23:38:49 -04:00
parent e5c03665e9
commit 36df47f019
2 changed files with 6 additions and 3 deletions
+1 -3
View File
@@ -70,7 +70,7 @@ def iniplist(ipaddr,iplist):
True True
>>> iniplist('4.2.2.2',['b.resolvers.Level3.net']) >>> iniplist('4.2.2.2',['b.resolvers.Level3.net'])
True True
>>> iniplist('2606:2800:220:1:248:1893:25c8:1946',['example.com/64']) >>> iniplist('2606:2800:220:1::',['example.com/40'])
True True
>>> iniplist('4.2.2.2',['nothing.example.com']) >>> iniplist('4.2.2.2',['nothing.example.com'])
False False
@@ -134,8 +134,6 @@ def parseaddr(t):
('God@heaven', 'jeff@spec.org') ('God@heaven', 'jeff@spec.org')
>>> parseaddr('Real Name ((comment)) <addr...@example.com>') >>> parseaddr('Real Name ((comment)) <addr...@example.com>')
('Real Name (comment)', 'addr...@example.com') ('Real Name (comment)', 'addr...@example.com')
>>> parseaddr('a(WRONG)@b')
('WRONG WRONG', 'a@b')
""" """
#return email.utils.parseaddr(t) #return email.utils.parseaddr(t)
res = email.utils.parseaddr(t) res = email.utils.parseaddr(t)
+5
View File
@@ -45,6 +45,11 @@ class AddrCacheTestCase(unittest.TestCase):
h = Milter.utils.parse_header(s) h = Milter.utils.parse_header(s)
self.assertEqual(h,b'Last Few Coldplay Album Artworks Available\x00') self.assertEqual(h,b'Last Few Coldplay Album Artworks Available\x00')
@unittest.expectedFailure
def testParseAddress(self):
s = Milter.utils.parseaddr('a(WRONG)@b')
self.assertEqual(s,('WRONG', 'a@b'))
def suite(): def suite():
s = unittest.makeSuite(AddrCacheTestCase,'test') s = unittest.makeSuite(AddrCacheTestCase,'test')
s.addTest(doctest.DocTestSuite(Milter.utils)) s.addTest(doctest.DocTestSuite(Milter.utils))