From 6e9afe3e54ab6fb0162393150b7892655b4561d4 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Thu, 24 Sep 2026 18:19:13 +0200 Subject: refactor(node): move the CLI out of daemon.py into cli/ Each `if args.command == ...` branch of main() becomes a function in cli/ (one module per family of verbs); the parser, the process setup and a VERBS table go to cli/parser.py and cli/dispatch.py. daemon.main runs the verb or starts the daemon. Tests patch the CLI through conftest.patch_cli; the CLI golden is unchanged. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-node/tests/test_roster_pairing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/meshbay-node/tests/test_roster_pairing.py') diff --git a/packages/meshbay-node/tests/test_roster_pairing.py b/packages/meshbay-node/tests/test_roster_pairing.py index ba16317..a2d0f8b 100644 --- a/packages/meshbay-node/tests/test_roster_pairing.py +++ b/packages/meshbay-node/tests/test_roster_pairing.py @@ -25,7 +25,7 @@ from meshbay_node.roster import Roster, hash_code, normalize_code from meshbay_node.transport.webrtc_server import WebRTCPeerSession from node_source import daemon_source, session_method, webrtc_source -from conftest import one_root +from conftest import one_root, patch_cli # ── Fixtures ────────────────────────────────────────────────────────────────── @@ -823,7 +823,7 @@ def _run_cli(monkeypatch, tmp_path, argv, responses): return value return {} - monkeypatch.setattr(_daemon, "_daemon_api", fake_api) + patch_cli(monkeypatch, "_daemon_api", fake_api) conf = tmp_path / "node.toml" tp = tmp_path.as_posix() # a raw Windows path is a TOML escape error -- cgit v1.2.3