mirror of
https://github.com/ShayManor/github-readme-stats.git
synced 2026-12-02 11:53:48 +05:30
feat(generator): add no-op cache wrapper (enables Redis later via env)
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
from src import cache
|
||||
|
||||
|
||||
def test_noop_when_redis_url_empty(monkeypatch):
|
||||
monkeypatch.setattr(cache.config, "REDIS_URL", "")
|
||||
c = cache.Cache()
|
||||
assert c.get("k") is None
|
||||
c.set("k", "v", 60)
|
||||
c.delete("k")
|
||||
assert c.get("k") is None # still None because no-op
|
||||
|
||||
|
||||
def test_enabled_flag_reflects_config(monkeypatch):
|
||||
monkeypatch.setattr(cache.config, "REDIS_URL", "")
|
||||
assert cache.Cache().enabled is False
|
||||
Reference in New Issue
Block a user