本文整理汇总了Python中raven.base.ClientState.should_try方法的典型用法代码示例。如果您正苦于以下问题:Python ClientState.should_try方法的具体用法?Python ClientState.should_try怎么用?Python ClientState.should_try使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类raven.base.ClientState
的用法示例。
在下文中一共展示了ClientState.should_try方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_should_try_retry_after_passed
# 需要导入模块: from raven.base import ClientState [as 别名]
# 或者: from raven.base.ClientState import should_try [as 别名]
def test_should_try_retry_after_passed(self):
state = ClientState()
state.status = state.ERROR
state.last_check = time.time() - 1
state.retry_number = 1
state.retry_after = 1
self.assertTrue(state.should_try())
示例2: test_should_try_time_passed_error
# 需要导入模块: from raven.base import ClientState [as 别名]
# 或者: from raven.base.ClientState import should_try [as 别名]
def test_should_try_time_passed_error(self):
state = ClientState()
state.status = state.ERROR
state.last_check = time.time() - 10
state.retry_number = 1
self.assertEquals(state.should_try(), True)
示例3: test_should_try_online
# 需要导入模块: from raven.base import ClientState [as 别名]
# 或者: from raven.base.ClientState import should_try [as 别名]
def test_should_try_online(self):
state = ClientState()
self.assertEquals(state.should_try(), True)