Exemplo 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)
Exemplo n.º 2
0
 def testSPFActionCheckScoreWithInvalidResult(self):
     spf = SPF()
     spf.result['action'] = 'foo'
     self.failUnlessRaises(GLPluginException, spf.get_score)
Exemplo n.º 3
0
 def testSPFActionCheckScoreWithValidResult(self):
     spf = SPF()
     spf.result['action'] = 'softfail'
     self.assertEqual(2, spf.get_score())
Exemplo n.º 4
0
 def testSPFScoreBeforeDoingTest(self):
     spf = SPF()
     self.assertEqual(None, spf.get_score())