本文整理汇总了Python中MilkCheck.Engine.BaseEntity.BaseEntity.status方法的典型用法代码示例。如果您正苦于以下问题:Python BaseEntity.status方法的具体用法?Python BaseEntity.status怎么用?Python BaseEntity.status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MilkCheck.Engine.BaseEntity.BaseEntity
的用法示例。
在下文中一共展示了BaseEntity.status方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_eval_deps_error
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import status [as 别名]
def test_eval_deps_error(self):
"""Test that eval_deps_status return DEP_ERROR"""
service = BaseEntity("test_service")
serv_a = BaseEntity("A")
serv_b = BaseEntity("B")
service.add_dep(serv_a)
service.add_dep(serv_b, CHECK)
serv_b.status = DONE
serv_a.status = TIMEOUT
self.assertEqual(service.eval_deps_status(), DEP_ERROR)
示例2: test_eval_deps_no_status
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import status [as 别名]
def test_eval_deps_no_status(self):
"""Test that eval_deps_status return NO_STATUS"""
service = BaseEntity("test_service")
serv_a = BaseEntity("A")
serv_b = BaseEntity("B")
serv_a.status = WARNING
service.add_dep(serv_a)
service.add_dep(serv_b, CHECK)
self.assertEqual(service.eval_deps_status(), NO_STATUS)
serv_a.status = NO_STATUS
serv_b.status = WARNING
self.assertEqual(service.eval_deps_status(), NO_STATUS)
示例3: test_eval_deps_warnings
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import status [as 别名]
def test_eval_deps_warnings(self):
"""eval_deps_status() is DONE with REQUIRE_WEAK on error"""
service = BaseEntity("test_service")
serv_a = BaseEntity("A")
serv_b = BaseEntity("B")
service.add_dep(serv_a, REQUIRE_WEAK)
service.add_dep(serv_b, REQUIRE_WEAK)
serv_a.status = DONE
serv_b.status = ERROR
self.assertEqual(service.eval_deps_status(), DONE)
serv_b.status = DEP_ERROR
serv_a.status = TIMEOUT
self.assertEqual(service.eval_deps_status(), DONE)
示例4: test_is_ready
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import status [as 别名]
def test_is_ready(self):
"""Test method allowing us to determine if a service can be processed"""
ent = BaseEntity('foo')
ent_dep = BaseEntity('parent')
ent_dep2 = BaseEntity('parent2')
ent.add_dep(ent_dep)
ent.add_dep(ent_dep2)
self.assertFalse(ent.is_ready())
ent_dep.status = WAITING_STATUS
self.assertFalse(ent.is_ready())
ent_dep.status = DONE
ent_dep2.status = DONE
self.assertTrue(ent.is_ready())
示例5: test_reset_entity
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import status [as 别名]
def test_reset_entity(self):
'''Test reset entity'''
ent = BaseEntity(name='foo', target='fortoy5')
ent.status = NO_STATUS
ent.algo_reverse = True
ent.reset()
self.assertEqual(ent._algo_reversed, False)
self.assertEqual(ent.status, NO_STATUS)
示例6: test_eval_deps_waiting
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import status [as 别名]
def test_eval_deps_waiting(self):
"""Test that eval_deps_status return WAITING_STATUS"""
service = BaseEntity("test_service")
serv_a = BaseEntity("A")
serv_b = BaseEntity("B")
service.add_dep(serv_a)
service.add_dep(serv_b, CHECK)
serv_a.status = WAITING_STATUS
self.assertEqual(service.eval_deps_status(), WAITING_STATUS)
示例7: test_search_deps
# 需要导入模块: from MilkCheck.Engine.BaseEntity import BaseEntity [as 别名]
# 或者: from MilkCheck.Engine.BaseEntity.BaseEntity import status [as 别名]
def test_search_deps(self):
"""Test method search_deps"""
ent = BaseEntity('test_service')
ent_a = BaseEntity('A')
ent_b = BaseEntity('B')
ent.add_dep(ent_a)
ent.add_dep(ent_b, CHECK)
self.assertEqual(len(ent.search_deps()), 2)
self.assertEqual(len(ent.search_deps([NO_STATUS])), 2)
ent_c = BaseEntity('C')
ent_c.status = DONE
ent.add_dep(ent_c)
self.assertEqual(len(ent.search_deps([NO_STATUS])), 2)
self.assertEqual(len(ent.search_deps([NO_STATUS, DONE])), 3)