本文整理汇总了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)