本文整理汇总了Python中MilkCheck.Engine.Action.Action.status方法的典型用法代码示例。如果您正苦于以下问题:Python Action.status方法的具体用法?Python Action.status怎么用?Python Action.status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MilkCheck.Engine.Action.Action
的用法示例。
在下文中一共展示了Action.status方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_reset_service
# 需要导入模块: from MilkCheck.Engine.Action import Action [as 别名]
# 或者: from MilkCheck.Engine.Action.Action import status [as 别名]
def test_reset_service(self):
'''Test resest values of a service'''
service = Service('brutus')
action = Action('start')
service.origin = True
action.status = DONE
service.add_action(action)
service._last_action = 'start'
service.reset()
self.assertFalse(service.origin)
self.assertFalse(service._last_action)
self.assertEqual(action.status, NO_STATUS)
self.assertEqual(service.status, NO_STATUS)
示例2: test_reset_service_group
# 需要导入模块: from MilkCheck.Engine.Action import Action [as 别名]
# 或者: from MilkCheck.Engine.Action.Action import status [as 别名]
def test_reset_service_group(self):
'''Test the ability to reset values of a service group'''
group = ServiceGroup('GROUP')
ser1 = Service('I1')
action = Action(name='start', delay=3)
action.maxretry = 5
action.tries = 3
action.status = DONE
ser1.add_action(action)
ser1.status = ERROR
group.add_inter_dep(target=ser1)
group.status = DEP_ERROR
group.reset()
self.assertEqual(group.status, NO_STATUS)
self.assertEqual(ser1.status, NO_STATUS)
self.assertEqual(action.status, NO_STATUS)
self.assertEqual(action.tries, 0)