Merge branch 'master' of github.com:sdgathman/pymilter
This commit is contained in:
+1
-1
@@ -72,7 +72,7 @@ $ python setup.py help
|
|||||||
* published. Unfortunately I know of no good way to do this
|
* published. Unfortunately I know of no good way to do this
|
||||||
* other than with OS-specific tests.
|
* other than with OS-specific tests.
|
||||||
*/
|
*/
|
||||||
#if defined(__FreeBSD__) || defined(__linux__) || defined(__sun__) || defined(__GLIBC__) || (defined(__APPLE__) && defined(__MACH__))
|
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__) || defined(__sun__) || defined(__GLIBC__) || (defined(__APPLE__) && defined(__MACH__))
|
||||||
#define HAVE_IPV6_RFC2553
|
#define HAVE_IPV6_RFC2553
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ class ConfigTestCase(unittest.TestCase):
|
|||||||
miltersrs = cp.getboolean('srsmilter','miltersrs')
|
miltersrs = cp.getboolean('srsmilter','miltersrs')
|
||||||
self.assertFalse(miltersrs)
|
self.assertFalse(miltersrs)
|
||||||
|
|
||||||
def suite(): return unittest.makeSuite(ConfigTestCase,'test')
|
def suite(): return unittest.TestLoader().loadTestsFromTestCase(ConfigTestCase)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
+3
-3
@@ -35,7 +35,7 @@ class GreylistTestCase(unittest.TestCase):
|
|||||||
# new one past expire
|
# new one past expire
|
||||||
rc = grey.check('1.2.3.5','foo@bar.com','baz@spat.com',timeinc=6*3600)
|
rc = grey.check('1.2.3.5','foo@bar.com','baz@spat.com',timeinc=6*3600)
|
||||||
self.assertEqual(rc,0)
|
self.assertEqual(rc,0)
|
||||||
# original past retain
|
# original past retain
|
||||||
rc = grey.check('1.2.3.4','foo@bar.com','baz@spat.com',timeinc=37*24*3600)
|
rc = grey.check('1.2.3.4','foo@bar.com','baz@spat.com',timeinc=37*24*3600)
|
||||||
self.assertEqual(rc,0)
|
self.assertEqual(rc,0)
|
||||||
# new one for testing expire
|
# new one for testing expire
|
||||||
@@ -48,8 +48,8 @@ class GreylistTestCase(unittest.TestCase):
|
|||||||
self.assertEqual(rc,1)
|
self.assertEqual(rc,1)
|
||||||
grey.close()
|
grey.close()
|
||||||
|
|
||||||
def suite():
|
def suite():
|
||||||
s = unittest.makeSuite(GreylistTestCase,'test')
|
s = unittest.TestLoader().loadTestsFromTestCase(GreylistTestCase)
|
||||||
return s
|
return s
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
+2
-2
@@ -71,7 +71,7 @@ class MimeTestCase(unittest.TestCase):
|
|||||||
self.fail('should get boundary error parsing bad rfc822 attachment')
|
self.fail('should get boundary error parsing bad rfc822 attachment')
|
||||||
except errors.BoundaryError:
|
except errors.BoundaryError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def testDefang(self,vname='virus1',part=1,
|
def testDefang(self,vname='virus1',part=1,
|
||||||
fname='LOVE-LETTER-FOR-YOU.TXT.vbs'):
|
fname='LOVE-LETTER-FOR-YOU.TXT.vbs'):
|
||||||
try:
|
try:
|
||||||
@@ -234,7 +234,7 @@ class MimeTestCase(unittest.TestCase):
|
|||||||
#print(msg + filter.msg)
|
#print(msg + filter.msg)
|
||||||
self.assertTrue(result.getvalue() == msg + filter.msg)
|
self.assertTrue(result.getvalue() == msg + filter.msg)
|
||||||
|
|
||||||
def suite(): return unittest.makeSuite(MimeTestCase,'test')
|
def suite(): return unittest.TestLoader().loadTestsFromTestCase(MimeTestCase)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
|
|||||||
+1
-1
@@ -42,7 +42,7 @@ class PolicyTestCase(unittest.TestCase):
|
|||||||
pol = p.getPolicy('smtp-test')
|
pol = p.getPolicy('smtp-test')
|
||||||
self.assertEqual(pol,'WILDCARD')
|
self.assertEqual(pol,'WILDCARD')
|
||||||
|
|
||||||
def suite(): return unittest.makeSuite(PolicyTestCase,'test')
|
def suite(): return unittest.TestLoader().loadTestsFromTestCase(PolicyTestCase)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
|
|||||||
+1
-1
@@ -142,7 +142,7 @@ class BMSMilterTestCase(unittest.TestCase):
|
|||||||
f.write(fp.getvalue())
|
f.write(fp.getvalue())
|
||||||
milter.close()
|
milter.close()
|
||||||
|
|
||||||
def suite(): return unittest.makeSuite(BMSMilterTestCase,'test')
|
def suite(): return unittest.TestLoader().loadTestsFromTestCase(BMSMilterTestCase)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
+2
-2
@@ -53,8 +53,8 @@ class AddrCacheTestCase(unittest.TestCase):
|
|||||||
s = Milter.utils.parseaddr('a(WRONG)@b')
|
s = Milter.utils.parseaddr('a(WRONG)@b')
|
||||||
self.assertEqual(s,('WRONG', 'a@b'))
|
self.assertEqual(s,('WRONG', 'a@b'))
|
||||||
|
|
||||||
def suite():
|
def suite():
|
||||||
s = unittest.makeSuite(AddrCacheTestCase,'test')
|
s = unittest.TestLoader().loadTestsFromTestCase(AddrCacheTestCase)
|
||||||
s.addTest(doctest.DocTestSuite(Milter.utils))
|
s.addTest(doctest.DocTestSuite(Milter.utils))
|
||||||
s.addTest(doctest.DocTestSuite(Milter.dynip))
|
s.addTest(doctest.DocTestSuite(Milter.dynip))
|
||||||
s.addTest(doctest.DocTestSuite(Milter.pyip6))
|
s.addTest(doctest.DocTestSuite(Milter.pyip6))
|
||||||
|
|||||||
Reference in New Issue
Block a user