示例#1
0
def test_failing_checks_result_in_503_status():
    info = health.HealthInfo([TrivialCheck(result=False)])
    assert info.status == 503
    assert info.check_results == {'TrivialCheck': False}
示例#2
0
def test_disabled_checks_are_ignored():
    info = health.HealthInfo([TrivialCheck(is_enabled=False)])
    assert info.status == 200
    assert info.check_results == {}
示例#3
0
def test_extended_checks_work():
    info = health.HealthInfo([TrivialExtendedCheck()])
    assert info.check_results == {}

    info = health.HealthInfo([TrivialExtendedCheck()], is_extended=True)
    assert info.check_results == {'TrivialExtendedCheck': True}