Skip to content
Snippets Groups Projects
Commit a36dcbfc authored by Stuart D. Gathman's avatar Stuart D. Gathman
Browse files

All unittests pass in py2 and py3!

parent 626d5ae2
No related branches found
No related tags found
No related merge requests found
......@@ -54,11 +54,11 @@ def is_dynip(host,addr):
if host.find(addr) >= 0: return True
if addr.find(':') >= 0: return False # IP6
a = addr.split('.')
ia = map(int,a)
ia = list(map(int,a))
h = host
m = ip3.findall(host)
if m:
g = map(int,m)[:4]
g = list(map(int,m))[:4]
ia3 = (ia[1:],ia[:3])
if g[-3:] in ia3: return True
if g[0] == ia[3] and g[1:3] == ia[:2]: return True
......
......@@ -133,7 +133,7 @@ def parseaddr(t):
>>> parseaddr('God@heaven <@hop1.org,@hop2.net:jeff@spec.org>')
('God@heaven', 'jeff@spec.org')
>>> parseaddr('Real Name ((comment)) <addr...@example.com>')
('Real Name', 'addr...@example.com')
('Real Name (comment)', 'addr...@example.com')
>>> parseaddr('a(WRONG)@b')
('WRONG', 'a@b')
"""
......
......@@ -43,7 +43,7 @@ class AddrCacheTestCase(unittest.TestCase):
def testParseHeader(self):
s='=?UTF-8?B?TGFzdCBGZXcgQ29sZHBsYXkgQWxidW0gQXJ0d29ya3MgQXZhaWxhYmxlAA?='
h = Milter.utils.parse_header(s)
self.assertEqual(h,'Last Few Coldplay Album Artworks Available\x00')
self.assertEqual(h,b'Last Few Coldplay Album Artworks Available\x00')
def suite():
s = unittest.makeSuite(AddrCacheTestCase,'test')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment