本文整理汇总了Python中MilkCheck.Engine.BaseEntity.BaseEntity.has_child_dep方法的典型用法代码示例。如果您正苦于以下问题:Python BaseEntity.has_child_dep方法的具体用法?Python BaseEntity.has_child_dep怎么用?Python BaseEntity.has_child_dep使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MilkCheck.Engine.BaseEntity.BaseEntity
的用法示例。
在下文中一共展示了BaseEntity.has_child_dep方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_has_child_dep
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import has_child_dep [as 别名]
def test_has_child_dep(self):
"""Test method has_child_dep"""
ent = BaseEntity('foo')
ent_dep = BaseEntity('child')
ent.children['child'] = Dependency(ent_dep)
self.assertTrue(ent.has_child_dep('child'))
del ent.children['child']
self.assertFalse(ent.has_child_dep('child'))
示例2: test_add_dep_children
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import has_child_dep [as 别名]
def test_add_dep_children(self):
"""Test method add_dep for children"""
ent = BaseEntity('foo')
ent_dep = BaseEntity('child')
ent.add_dep(target=ent_dep, parent=False)
self.assertTrue(ent.has_child_dep('child'))
self.assertTrue(ent_dep.has_parent_dep('foo'))
示例3: test_add_dep_parents
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import has_child_dep [as 别名]
def test_add_dep_parents(self):
"""Test method add dependency for parents"""
ent = BaseEntity('foo')
ent_dep = BaseEntity('parent')
ent.add_dep(ent_dep)
self.assertTrue(ent.has_parent_dep('parent'))
self.assertTrue(ent_dep.has_child_dep('foo'))
示例4: test_clear_childs
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import has_child_dep [as 别名]
def test_clear_childs(self):
'''Test remove all childrens dependencies'''
ent1 = BaseEntity(name='A')
ent2 = BaseEntity(name='B')
ent3 = BaseEntity(name='C')
ent1.add_dep(target=ent2, parent=False)
ent1.add_dep(target=ent3, parent=False)
ent1.clear_child_deps()
self.assertFalse(ent1.has_child_dep('B'))
self.assertFalse(ent1.has_child_dep('C'))