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 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')