本文整理汇总了Python中MilkCheck.Engine.BaseEntity.BaseEntity.search方法的典型用法代码示例。如果您正苦于以下问题:Python BaseEntity.search方法的具体用法?Python BaseEntity.search怎么用?Python BaseEntity.search使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MilkCheck.Engine.BaseEntity.BaseEntity
的用法示例。
在下文中一共展示了BaseEntity.search方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_search_node_graph_reverse
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import search [as 别名]
def test_search_node_graph_reverse(self):
"""Test the research of node through a graph in reverse mod"""
ent1 = BaseEntity('E1')
ent2 = BaseEntity('E2')
ent3 = BaseEntity('E3')
ent4 = BaseEntity('E4')
ent1.add_dep(ent2)
ent1.add_dep(ent3)
ent2.add_dep(ent4)
ent3.add_dep(ent4)
self.assertTrue(ent4.search('E1', True) is ent1)
self.assertTrue(ent4.search('E5', True) is None)
示例2: test_search_node_graph
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import search [as 别名]
def test_search_node_graph(self):
"""Test the research of a node through a graph"""
ent1 = BaseEntity('E1')
ent2 = BaseEntity('E2')
ent3 = BaseEntity('E3')
ent4 = BaseEntity('E4')
ent1.add_dep(ent2)
ent1.add_dep(ent3)
ent2.add_dep(ent4)
ent3.add_dep(ent4)
self.assertTrue(ent1.search('E3') is ent3)
self.assertTrue(ent1.search('E5') is None)