コード例 #1
0
def test_redis_check(client, reset_checks, settings):
    settings.DOCKERFLOW_CHECKS = [
        'dockerflow.django.checks.check_redis_connected',
    ]
    checks.register()
    response = client.get('/__heartbeat__')
    assert response.status_code == 200
コード例 #2
0
def test_redis_check(dockerflow_middleware, reset_checks, rf, settings):
    settings.DOCKERFLOW_CHECKS = [
        'dockerflow.django.checks.check_redis_connected',
    ]
    checks.register()
    request = rf.get('/__heartbeat__')
    response = dockerflow_middleware.process_request(request)
    assert response.status_code == 200
コード例 #3
0
def test_heartbeat(client, reset_checks, settings):
    response = client.get('/__heartbeat__')
    assert response.status_code == 200

    settings.DOCKERFLOW_CHECKS = [
        'tests.checks.warning',
        'tests.checks.error',
    ]
    checks.register()
    response = client.get('/__heartbeat__')
    assert response.status_code == 500
コード例 #4
0
def test_heartbeat(dockerflow_middleware, reset_checks, rf, settings):
    request = rf.get('/__heartbeat__')
    response = dockerflow_middleware.process_request(request)
    assert response.status_code == 200

    settings.DOCKERFLOW_CHECKS = [
        'tests.checks.warning',
        'tests.checks.error',
    ]
    checks.register()
    response = dockerflow_middleware.process_request(request)
    assert response.status_code == 500