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

Method test_history_limit

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

Source from the content-addressed store, hash-verified

212 assert h[1].model == "first"
213
214 def test_history_limit(self) -> None:
215 now = time.time()
216 rs = RouteStats(storage=InMemoryRouteStatsStorage(), now_fn=lambda: now)
217 for i in range(10):
218 rs.record(_make_record(ts=now - 10 + i))
219 assert len(rs.history(limit=3)) == 3
220
221 def test_reset(self) -> None:
222 rs = RouteStats(storage=InMemoryRouteStatsStorage())

Callers

nothing calls this directly

Calls 5

recordMethod · 0.95
historyMethod · 0.95
RouteStatsClass · 0.90
_make_recordFunction · 0.85

Tested by

no test coverage detected