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

Method test_summary_by_method

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

Source from the content-addressed store, hash-verified

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())
105 rs.record(_make_record(method="pool"))
106 rs.record(_make_record(method="pool"))
107 rs.record(_make_record(method="fallback"))
108 s = rs.summary()
109 assert s.by_method["pool"] == 2
110 assert s.by_method["fallback"] == 1
111
112 def test_actual_cost_preferred(self) -> None:
113 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