当前位置: 首页>>代码示例>>Python>>正文


Python BaseEntity.inherits_from方法代码示例

本文整理汇总了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)
开发者ID:cea-hpc,项目名称:milkcheck,代码行数:10,代码来源:BaseEntityTest.py

示例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']))
开发者ID:cea-hpc,项目名称:milkcheck,代码行数:13,代码来源:BaseEntityTest.py

示例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, "")
开发者ID:cea-hpc,项目名称:milkcheck,代码行数:13,代码来源:BaseEntityTest.py

示例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)
开发者ID:cea-hpc,项目名称:milkcheck,代码行数:14,代码来源:BaseEntityTest.py

示例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)
开发者ID:cea-hpc,项目名称:milkcheck,代码行数:7,代码来源:ServiceGroup.py

示例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)
开发者ID:pombredanne,项目名称:milkcheck,代码行数:7,代码来源:Service.py


注:本文中的MilkCheck.Engine.BaseEntity.BaseEntity.inherits_from方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。