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