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

Function test_flush_on_failure_keeps_buffer

tests/test_telemetry.py:160–173  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

158
159
160def test_flush_on_failure_keeps_buffer(tmp_path):
161 _reset(tmp_path)
162 telem.enable()
163
164 rec = telem.TelemetryRecord(predicted_tier=1, outcome="http_error")
165 telem.buffer_record(rec)
166
167 # Mock failed send
168 with mock.patch.object(telem, "_send_batch", return_value=False):
169 count = telem.flush()
170
171 assert count == 0
172 assert telem.status()["pending_records"] == 1 # still pending
173 assert telem.status()["total_sent"] == 0
174
175
176def test_disabled_telemetry_does_not_buffer(tmp_path):

Callers

nothing calls this directly

Calls 2

_resetFunction · 0.85
statusMethod · 0.45

Tested by

no test coverage detected