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

Class _FakeClock

tests/test_spend_control.py:161–171  ·  view source on GitHub ↗

Deterministic clock for testing time-windowed logic.

Source from the content-addressed store, hash-verified

159
160
161class _FakeClock:
162 """Deterministic clock for testing time-windowed logic."""
163
164 def __init__(self, start: float) -> None:
165 self._now = start
166
167 def __call__(self) -> float:
168 return self._now
169
170 def advance(self, seconds: float) -> None:
171 self._now += seconds

Callers 3

test_hourly_limitMethod · 0.85
test_daily_limitMethod · 0.85

Calls

no outgoing calls

Tested by 3

test_hourly_limitMethod · 0.68
test_daily_limitMethod · 0.68