當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。