diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-09-24 17:44:08 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-09-24 17:58:08 +0200 |
| commit | c2dabdb870ecd8fd8ea6392e44258de02e9ad467 (patch) | |
| tree | 6a71e00385b52cb65e54989c0fea923b88d24dff /packages | |
| parent | ef942b93d1e9bfc28bf607dfaf501cc7d9685e7b (diff) | |
| download | meshbay-c2dabdb870ecd8fd8ea6392e44258de02e9ad467.tar.gz | |
test(node): keep the CLI dispatch test off the developer's node
The stub left HOME and config.DEFAULT_CONFIG_PATH real: every run wrote
TEST-CODE over ~/.local/share/meshbay/invite-code and pair-code, and
`status` read the real keystore and asked the running node.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/meshbay-node/tests/test_cli_dispatch.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/meshbay-node/tests/test_cli_dispatch.py b/packages/meshbay-node/tests/test_cli_dispatch.py index d73dfcf..26ffb05 100644 --- a/packages/meshbay-node/tests/test_cli_dispatch.py +++ b/packages/meshbay-node/tests/test_cli_dispatch.py @@ -113,6 +113,14 @@ def stub_daemon(monkeypatch, tmp_path): conf = tmp_path / "node.toml" conf.write_text('[hub]\nurl = "https://example.invalid"\n') monkeypatch.setattr(daemon_mod, "DEFAULT_CONFIG_PATH", conf) + # And a home of its own: the data directory (where `member invite` and + # `operator pair` write their code, where `status` finds the run token of + # a live node) and the keystore's default path are both derived from it. + # Without this, every run wrote TEST-CODE over the developer's own + # invite-code and asked their running node for its status. + from meshbay_node import config as config_mod + monkeypatch.setenv("HOME", str(tmp_path / "home")) + monkeypatch.setattr(config_mod, "DEFAULT_CONFIG_PATH", conf) # No interactive prompt left to hang on. monkeypatch.setattr("builtins.input", lambda *a: "n") |