当前位置: 首页>>代码示例>>Python>>正文


Python Interface.addChild方法代码示例

本文整理汇总了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')
开发者ID:BecomingMore,项目名称:faraday,代码行数:9,代码来源:model_composite.py

示例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") 
开发者ID:BecomingMore,项目名称:faraday,代码行数:12,代码来源:model_composite.py

示例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)
开发者ID:BwRy,项目名称:faraday,代码行数:8,代码来源:model_controller.py

示例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)
开发者ID:BwRy,项目名称:faraday,代码行数:8,代码来源:model_controller.py

示例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)
开发者ID:BecomingMore,项目名称:faraday,代码行数:8,代码来源:dont_run_but_update_model_controller.py

示例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)
开发者ID:BecomingMore,项目名称:faraday,代码行数:8,代码来源:dont_run_but_update_model_controller.py


注:本文中的model.hosts.Interface.addChild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。