Spaces:
Sleeping
Sleeping
| """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 | |
| 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 | |