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:")
def test_cache_unhealthy_configuration(): assert cache_subsystem.healthy() is not True
def test_cache_healthy(redis_cache): assert cache_subsystem.healthy() is True