本文整理匯總了Python中model.hosts.Interface.addChild方法的典型用法代碼示例。如果您正苦於以下問題:Python Interface.addChild方法的具體用法?Python Interface.addChild怎麽用?Python Interface.addChild使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類model.hosts.Interface
的用法示例。
在下文中一共展示了Interface.addChild方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testAddServiceToInterface
# 需要導入模塊: from model.hosts import Interface [as 別名]
# 或者: from model.hosts.Interface import addChild [as 別名]
def testAddServiceToInterface(self):
interface = Interface('coco')
serv = Service('cuca')
interface.addChild(serv)
self.assertIn(serv, interface.childs.values(), 'Service not in childs')
self.assertIn(serv, interface.getAllServices(), 'Service not accessible')
示例2: testInterfaceWithMultipleChildTypes
# 需要導入模塊: from model.hosts import Interface [as 別名]
# 或者: from model.hosts.Interface import addChild [as 別名]
def testInterfaceWithMultipleChildTypes(self):
inter = Interface('coco')
serv = Service('cuca')
vuln = ModelObjectVuln('vuln')
inter.addChild(serv)
inter.addChild(vuln)
self.assertEquals(len(inter.getVulns()), 1, "Vulns added is not 1")
self.assertIn(vuln, inter.getVulns(), "Vuln not accessible")
self.assertEquals(len(inter.getAllServices()), 1, "Services added is not 1")
示例3: testDelNoteFromInterfaceASYNC
# 需要導入模塊: from model.hosts import Interface [as 別名]
# 或者: from model.hosts.Interface import addChild [as 別名]
def testDelNoteFromInterfaceASYNC(self):
interface = Interface('coco')
note = ModelObjectNote("int_mock0")
interface.addChild(note.getID(), note)
self.genericDelTest(interface, note,
controller.ModelController.delNoteFromInterfaceASYNC, process_pending=True)
示例4: testInterfaceFromHostRemovedASYNC
# 需要導入模塊: from model.hosts import Interface [as 別名]
# 或者: from model.hosts.Interface import addChild [as 別名]
def testInterfaceFromHostRemovedASYNC(self):
service = Service('coco')
interface = Interface("int_mock0")
interface.addChild(service.getID(), service)
self.genericDelTest(interface, service,
controller.ModelController.delServiceFromInterfaceASYNC, process_pending=True)
示例5: testDelNoteFromInterfaceSYNC
# 需要導入模塊: from model.hosts import Interface [as 別名]
# 或者: from model.hosts.Interface import addChild [as 別名]
def testDelNoteFromInterfaceSYNC(self):
interface = Interface('coco')
note = ModelObjectNote("int_mock0")
interface.addChild(note)
self.genericDelTest(interface, note,
controller.ModelController.delNoteFromInterfaceSYNC)
示例6: testInterfaceFromHostRemovedSYNC
# 需要導入模塊: from model.hosts import Interface [as 別名]
# 或者: from model.hosts.Interface import addChild [as 別名]
def testInterfaceFromHostRemovedSYNC(self):
service = Service('coco')
interface = Interface("int_mock0")
interface.addChild(service)
self.genericDelTest(interface, service,
controller.ModelController.delServiceFromInterfaceSYNC)