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

Method test_summary_by_tier

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

Source from the content-addressed store, hash-verified

80 assert rs.count == 2
81
82 def test_summary_by_tier(self) -> None:
83 rs = RouteStats(storage=InMemoryRouteStatsStorage())
84 rs.record(_make_record(tier="SIMPLE", confidence=0.9))
85 rs.record(_make_record(tier="SIMPLE", confidence=0.8))
86 rs.record(_make_record(tier="COMPLEX", confidence=0.7, model="google/gemini-3.1-pro"))
87 s = rs.summary()
88 assert s.total_requests == 3
89 assert s.by_tier["SIMPLE"].count == 2
90 assert s.by_tier["COMPLEX"].count == 1
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())

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