MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / test_summary_by_model

Method test_summary_by_model

tests/test_stats.py:93–101  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

91 assert abs(s.by_tier["SIMPLE"].avg_confidence - 0.85) < 0.01
92
93 def test_summary_by_model(self) -> None:
94 rs = RouteStats(storage=InMemoryRouteStatsStorage())
95 rs.record(_make_record(model="a/b", estimated_cost=0.01))
96 rs.record(_make_record(model="a/b", estimated_cost=0.02))
97 rs.record(_make_record(model="c/d", estimated_cost=0.05))
98 s = rs.summary()
99 assert s.by_model["a/b"].count == 2
100 assert s.by_model["c/d"].count == 1
101 assert abs(s.by_model["a/b"].total_cost - 0.03) < 1e-9
102
103 def test_summary_by_method(self) -> None:
104 rs = RouteStats(storage=InMemoryRouteStatsStorage())

Callers

nothing calls this directly

Calls 5

recordMethod · 0.95
summaryMethod · 0.95
RouteStatsClass · 0.90
_make_recordFunction · 0.85

Tested by

no test coverage detected