RICS / app /tests /test_llm_throttle_cache_stub.py
StormShadow308's picture
feat: async pipeline, job queue, generation hardening, and docs
732b14f
Raw
History Blame Contribute Delete
578 Bytes
"""Coverage for cache_hit_out wiring on throttled LLM calls."""
from __future__ import annotations
import pytest
from app.llm.llm_throttle import make_cache_hit_slot, throttled_llm_call
@pytest.mark.asyncio
async def test_throttled_llm_call_reads_cache_hit_out() -> None:
slot = make_cache_hit_slot()
async def _call() -> str:
slot[0] = True
return "ok"
result = await throttled_llm_call(
phase="test",
section_id=None,
cache_hit_out=slot,
call=_call,
)
assert result == "ok"
assert slot[0] is True