How to use the dockerflow.django.checks.check_redis_connected function in dockerflow

To help you get started, we’ve selected a few dockerflow examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozilla-services / python-dockerflow / tests / django / test_django.py View on Github external
def test_check_redis_connected_ping_failed(mocker):
    get_redis_connection = mocker.patch("django_redis.get_redis_connection")
    get_redis_connection.return_value.ping.return_value = False
    errors = checks.check_redis_connected([])
    assert len(errors) == 1
    assert errors[0].id == health.ERROR_REDIS_PING_FAILED
github mozilla-services / python-dockerflow / tests / django / test_django.py View on Github external
def test_check_redis_connected(mocker, exception, error):
    get_redis_connection = mocker.patch("django_redis.get_redis_connection")
    get_redis_connection.side_effect = exception
    errors = checks.check_redis_connected([])
    assert len(errors) == 1
    assert errors[0].id == error