Files
routstr-core/tests
Jeroen UbbinkandClaude Opus 5 b68086c592 test(pricing): pin rate validation to every billable rate, not the token pair
The write-edge validator and the served-catalog backstop both iterate the full
billable-rate tuple, but every test drove them through `prompt` alone — the
tuple could be narrowed to the two token rates and the suite stayed green,
while a malformed image/search/reasoning/cache rate walked in.

Covers each remaining rate at both surfaces. `request` is deliberately absent
from the catalog list and pinned by its own test instead: the row-to-model
conversion clamps a negative stored `request` to zero before the price is
built, so the backstop never sees one.

Also covers the exchange-quote reader's widened error handling, which had no
test: a body that never yields JSON raises before any number is read, and
unhandled it abandoned the whole aggregation with two healthy quotes in hand.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011cKHVF5LA7TR5QuYi6ErLM
2026-08-25 20:28:16 +02:00
..
2025-08-06 20:31:55 -03:00