def testAddVulnToInterface(self): serv = Service('cuca') vuln = ModelObjectVuln('vuln') serv.addChild(vuln) self.assertIn(vuln, serv.childs.values(), 'Vuln not in childs') self.assertIn(vuln, serv.getVulns(), 'Vuln not accessible')
def testDelCredentialFromServiceASYNC(self): service = Service('coco') cred = ModelObjectCred("int_mock0") service.addChild(cred) self.genericDelTest(service, cred, controller.ModelController.delCredFromServiceASYNC, process_pending=True)
def testDelNoteFromServiceASYNC(self): service = Service('coco') note = ModelObjectNote("int_mock0") service.addChild(note) self.genericDelTest(service, note, controller.ModelController.delNoteFromServiceASYNC, process_pending=True)
def testDelVulnFromServiceASYNC(self): service = Service('coco') vuln = ModelObjectVuln("int_mock0") service.addChild(vuln) self.genericDelTest(service, vuln, controller.ModelController.delVulnFromServiceASYNC, process_pending=True)
def testServiceWithMultipleChildTypes(self): serv = Service('cuca') vuln = ModelObjectVuln('vuln') note = ModelObjectNote('nota') serv.addChild(note) serv.addChild(vuln) self.assertEquals(len(serv.getVulns()), 1, "Vulns added is not 1") self.assertIn(vuln, serv.getVulns(), "Vuln not accessible") self.assertEquals(len(serv.getNotes()), 1, "Notes added is not 1") self.assertIn(note, serv.getNotes(), "Note not accessible")
def testDelCredentialFromModelObjectSYNC(self): service = Service('coco') cred = ModelObjectCred("int_mock0") service.addChild(cred.getID(), cred) self.genericDelTest(service, cred, controller.ModelController.delCredSYNC)
def testDelCredentialFromServiceASYNC(self): service = Service('coco') cred = ModelObjectCred("int_mock0") service.addChild(cred.getID(), cred) self.genericDelTest(service, cred, controller.ModelController.delCredFromServiceASYNC, process_pending=True)
def testDelNoteFromServiceASYNC(self): service = Service('coco') note = ModelObjectNote("int_mock0") service.addChild(note.getID(), note) self.genericDelTest(service, note, controller.ModelController.delNoteFromServiceASYNC, process_pending=True)
def testDelVulnFromServiceASYNC(self): service = Service('coco') vuln = ModelObjectVuln("int_mock0") service.addChild(vuln.getID(), vuln) self.genericDelTest(service, vuln, controller.ModelController.delVulnFromServiceASYNC, process_pending=True)
def testDelNoteFromServiceSYNC(self): service = Service('coco') note = ModelObjectNote("int_mock0") service.addChild(note) self.genericDelTest(service, note, controller.ModelController.delNoteFromServiceSYNC)
def testDelVulnFromServiceSYNC(self): service = Service('coco') vuln = ModelObjectVuln("int_mock0") service.addChild(vuln) self.genericDelTest(service, vuln, controller.ModelController.delVulnFromServiceSYNC)
def testDelCredentialFromModelObjectSYNC(self): service = Service('coco') cred = ModelObjectCred("int_mock0") service.addChild(cred) self.genericDelTest(service, cred, controller.ModelController.delCredSYNC)