test(gateway): repoint slash-command mocks after mixin extraction

Tests for the extracted handlers mocked symbols at gateway.run.*; the handlers
now resolve top-level-imported deps (atomic_json_write, fetch_account_usage,
render_account_usage_lines) and __file__ from gateway.slash_commands. Repoint
those mocks. run.py-resident methods (_increment_restart_failure_counts,
_clear_restart_failure_count) keep their gateway.run.atomic_json_write mock —
only the moved handlers' mocks change.

tests/gateway/ 6415 passed / 0 failed.
This commit is contained in:
teknium1
2026-06-08 01:25:35 -07:00
committed by Teknium
parent 619bd78273
commit de5fe2fa7d
3 changed files with 15 additions and 8 deletions
@@ -153,6 +153,10 @@ async def test_restart_command_uses_atomic_json_writes_for_marker_files(tmp_path
def _fake_atomic_json_write(path, payload, **kwargs):
calls.append((Path(path).name, payload, kwargs))
# _handle_restart_command lives in gateway/slash_commands.py (extracted from
# run.py); it uses that module's top-level atomic_json_write import.
import gateway.slash_commands as gateway_slash
monkeypatch.setattr(gateway_slash, "atomic_json_write", _fake_atomic_json_write)
monkeypatch.setattr(gateway_run, "atomic_json_write", _fake_atomic_json_write)
runner, _adapter = make_restart_runner()