diff options
Diffstat (limited to 'packages/meshbay-node/tests/test_root_paths_are_operator_only.py')
| -rw-r--r-- | packages/meshbay-node/tests/test_root_paths_are_operator_only.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/meshbay-node/tests/test_root_paths_are_operator_only.py b/packages/meshbay-node/tests/test_root_paths_are_operator_only.py index a18e9fa..e00f1cf 100644 --- a/packages/meshbay-node/tests/test_root_paths_are_operator_only.py +++ b/packages/meshbay-node/tests/test_root_paths_are_operator_only.py @@ -26,6 +26,8 @@ from meshbay_node import daemon as daemon_mod from meshbay_node import ops from meshbay_node.roots import RootSet +from conftest import patch_cli + def _roots(tmp_path: Path) -> RootSet: for name in ("Films", "Albums"): @@ -116,12 +118,14 @@ def test_the_cli_only_reads_fields_the_payload_carries(monkeypatch, tmp_path, ca return super().get(key, default) gid = "g" * 32 - monkeypatch.setattr(daemon_mod, "_daemon_api", lambda cfg, path, **kw: { + patch_cli(monkeypatch, "_daemon_api", lambda cfg, path, **kw: { "groups": [{"id": gid, "roots": [_Recording(offered)]}]}) - monkeypatch.setattr(daemon_mod, "_resolve_group", lambda cfg, g: gid) + patch_cli(monkeypatch, "_resolve_group", lambda cfg, g: gid) conf = tmp_path / "node.toml" conf.write_text('[hub]\nurl = "https://example.invalid"\n') - monkeypatch.setattr(daemon_mod, "DEFAULT_CONFIG_PATH", conf) + patch_cli(monkeypatch, "DEFAULT_CONFIG_PATH", conf) + # A stub missed would otherwise reach the node running on this machine. + monkeypatch.setenv("HOME", str(tmp_path / "home")) monkeypatch.setattr(sys, "argv", ["meshbay-node", "root", "list"]) daemon_mod.main() |