Ejemplo n.º 1
0
 def testSPFCheckWithValidHeaders(self):
     headers = {}
     headers['client_address'] = '67.207.130.103'
     headers['helo_name'] = 'urd.winthernet.se'
     headers['sender'] = '*****@*****.**'
     result_dict = {'action': 'pass', 
                    'code': 250, 
                    'message': 'sender SPF authorized'}
     spf = SPF(headers)
     spf.do_test()
     self.assertEqual(result_dict, spf.result)
Ejemplo n.º 2
0
 def testSPFActionCheckScoreWithInvalidResult(self):
     spf = SPF()
     spf.result['action'] = 'foo'
     self.failUnlessRaises(GLPluginException, spf.get_score)
Ejemplo n.º 3
0
 def testSPFActionCheckScoreWithValidResult(self):
     spf = SPF()
     spf.result['action'] = 'softfail'
     self.assertEqual(2, spf.get_score())
Ejemplo n.º 4
0
 def testSPFScoreBeforeDoingTest(self):
     spf = SPF()
     self.assertEqual(None, spf.get_score())