示例#1
0
def test_cache_unhealthy_service(redis_cache, monkeypatch):
    mock_cache = Mock(redis_cache)
    mock_cache.cache._read_clients.ping.side_effect = redis.TimeoutError
    monkeypatch.setattr("landoapi.cache.cache", mock_cache)
    monkeypatch.setattr("landoapi.cache.RedisCache", type(mock_cache.cache))

    health = cache_subsystem.healthy()
    assert health is not True
    assert health.startswith("RedisError:")
示例#2
0
def test_cache_unhealthy_configuration():
    assert cache_subsystem.healthy() is not True
示例#3
0
def test_cache_healthy(redis_cache):
    assert cache_subsystem.healthy() is True