本文整理汇总了Python中MilkCheck.Engine.BaseEntity.BaseEntity.inherits_from方法的典型用法代码示例。如果您正苦于以下问题:Python BaseEntity.inherits_from方法的具体用法?Python BaseEntity.inherits_from怎么用?Python BaseEntity.inherits_from使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MilkCheck.Engine.BaseEntity.BaseEntity
的用法示例。
在下文中一共展示了BaseEntity.inherits_from方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_remote
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import inherits_from [as 别名]
def test_remote(self):
"""Test the remote property"""
ent1 = BaseEntity('father')
self.assertTrue(ent1.remote)
ent1.remote = False
ent2 = BaseEntity('child')
ent2.inherits_from(ent1)
self.assertFalse(ent2.remote)
示例2: test_tags
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import inherits_from [as 别名]
def test_tags(self):
"""Test tags property"""
ent1 = BaseEntity(name='parent')
self.assertEqual(ent1.tags, set())
ent1.tags.add('foo')
ent2 = BaseEntity(name='child')
ent2.inherits_from(ent1)
self.assertEqual(ent2.tags, set(['foo']))
ent2.tags = set(['bar'])
self.assertEqual(ent2.tags, set(['bar']))
示例3: test_inheritance_of_non_existing_target
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import inherits_from [as 别名]
def test_inheritance_of_non_existing_target(self):
'''
Test inheritance between entities with non-existing target/description
'''
ent1 = BaseEntity(name='parent')
ent1.desc = "foo"
ent2 = BaseEntity(name='child', target="@none")
ent2.desc = ""
ent2.inherits_from(ent1)
self.assertEqual(ent2.target, NodeSet())
self.assertEqual(ent2.desc, "")
示例4: test_inheritance_of_properties1
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import inherits_from [as 别名]
def test_inheritance_of_properties1(self):
'''Test inheritance between entities'''
ent1 = BaseEntity(name='parent', target='aury[10-16]')
ent1.fanout = 5
ent1.errors = 2
ent1.timeout = 15
ent2 = BaseEntity(name='child')
ent2.inherits_from(ent1)
self.assertEqual(ent2.target, NodeSet('aury[10-16]'))
self.assertEqual(ent2.fanout, 5)
self.assertEqual(ent2.errors, 2)
self.assertEqual(ent2.timeout, 15)
示例5: inherits_from
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import inherits_from [as 别名]
def inherits_from(self, entity):
'''Inherit properties from entity'''
BaseEntity.inherits_from(self, entity)
for subservice in self.iter_subservices():
subservice.inherits_from(self)
示例6: inherits_from
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import inherits_from [as 别名]
def inherits_from(self, entity):
"""Inherit properties from entity"""
BaseEntity.inherits_from(self, entity)
for action in self.iter_actions():
action.inherits_from(self)