def testRBLCheckWithInvalidHeaderValues(self): headers = {} headers['client_address'] = 'foo' settings = Settings() rbl = RBL(headers, settings) rbl.servers = self.servers self.failUnlessRaises(socket.gaierror, rbl.do_test)
def testRBLCheckWithValidHeaders(self): headers = {} headers['client_address'] = '67.207.130.103' result_dict = {'dul.dnsbl.sorbs.net': None} rbl = RBL(headers, Settings()) rbl.servers = self.servers rbl.do_test() self.assertEqual(result_dict, rbl.results)
def testRBLCheckWithEmptyHeaders(self): rbl = RBL(settings=Settings()) rbl.servers = self.servers self.failUnlessRaises(GLPluginException, rbl.do_test)