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

Method test_status

tests/test_spend_control.py:85–94  ·  view source on GitHub ↗
(self, spend_control: SpendControl)

Source from the content-addressed store, hash-verified

83 spend_control.record(-0.01)
84
85 def test_status(self, spend_control: SpendControl) -> None:
86 spend_control.set_limit("hourly", 5.00)
87 spend_control.record(1.00, model="model-a")
88 spend_control.record(0.50, model="model-b")
89
90 s = spend_control.status()
91 assert s.limits.hourly == 5.00
92 assert s.spent["session"] == pytest.approx(1.50)
93 assert s.remaining["hourly"] == pytest.approx(3.50)
94 assert s.calls == 2
95
96 def test_history(self, spend_control: SpendControl) -> None:
97 spend_control.record(0.10, model="a")

Callers

nothing calls this directly

Calls 3

set_limitMethod · 0.80
recordMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected