本文整理汇总了Python中MilkCheck.Engine.BaseEntity.BaseEntity.children['child']方法的典型用法代码示例。如果您正苦于以下问题:Python BaseEntity.children['child']方法的具体用法?Python BaseEntity.children['child']怎么用?Python BaseEntity.children['child']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MilkCheck.Engine.BaseEntity.BaseEntity
的用法示例。
在下文中一共展示了BaseEntity.children['child']方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_has_child_dep
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import children['child'] [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_remove_dep
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import children['child'] [as 别名]
def test_remove_dep(self):
"""Test method remove_dep."""
ent = BaseEntity('foo')
ent_dep = BaseEntity('child')
ent.children['child'] = Dependency(ent_dep)
ent_dep.parents['foo'] = Dependency(ent)
ent.remove_dep('child', parent=False)
self.assertTrue('child' not in ent.children)
self.assertTrue('foo' not in ent.parents)
self.assertRaises(AssertionError, ent.remove_dep, None)