class UserScanningTest(unittest.TestCase): def setUp(self): self.domain = 'gatorhole.com' self.p = UserScanning() def testSuccessful(self): data = {'mx_record': [{'connection_type': 'INET', 'ip': '109.228.153.253', 'host': 'maple.lonn.org', 'prio': '10'}]} self.p.setInput('MXRecord', data) self.email = '*****@*****.**' r = runTestPlugin(self.p, self.domain, self.email) status = r.getFinalStatus() self.assertEqual(status, Plugin.STATUS_OK) def testFailiure(self): data = {'mx_record': [{'connection_type': 'INET', 'ip': '109.228.153.253', 'host': 'maple.lonn.org', 'prio': '10'}]} self.p.setInput('MXRecord', data) self.email = '*****@*****.**' r = runTestPlugin(self.p, self.domain, self.email) status = r.getFinalStatus() self.assertEqual(status, Plugin.STATUS_WARNING)
class UserScanningTest(unittest.TestCase): def setUp(self): self.domain = 'gatorhole.com' self.p = UserScanning() def testSuccessful(self): data = { 'mx_record': [{ 'connection_type': 'INET', 'ip': '109.228.153.253', 'host': 'maple.lonn.org', 'prio': '10' }] } self.p.setInput('MXRecord', data) self.email = '*****@*****.**' r = runTestPlugin(self.p, self.domain, self.email) status = r.getFinalStatus() self.assertEqual(status, Plugin.STATUS_OK) def testFailiure(self): data = { 'mx_record': [{ 'connection_type': 'INET', 'ip': '109.228.153.253', 'host': 'maple.lonn.org', 'prio': '10' }] } self.p.setInput('MXRecord', data) self.email = '*****@*****.**' r = runTestPlugin(self.p, self.domain, self.email) status = r.getFinalStatus() self.assertEqual(status, Plugin.STATUS_WARNING)
def setUp(self): self.domain = 'gatorhole.com' self.p = UserScanning()