aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/tests/test_root_paths_are_operator_only.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-27 22:21:26 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-27 22:21:26 +0200
commita45e77df1b0024707914a446aa89d33baa223787 (patch)
tree969a4976c91d7aaa27b11ba212f99d69e2ccce0f /packages/meshbay-node/tests/test_root_paths_are_operator_only.py
parentc7899e2218af26f3bab6a157c70acf5eb7871da6 (diff)
downloadmeshbay-a45e77df1b0024707914a446aa89d33baa223787.tar.gz
test: make both suites pass on Windows
Most of these failed on Windows for reasons that had nothing to do with the code under test, which is how real Windows defects hid among them: - Read and write files as UTF-8, and talk to Node in UTF-8. read_text(), write_text() and subprocess text=True use the locale codepage, cp1252 on Windows: "é", "—" and "→" arrived as "?" or crashed, some sixty tests. Calls to PowerShell and schtasks are left alone -- they answer in the console codepage. - Import ESM harness modules by file URL (as_uri): a raw "C:\..." path is not a module specifier. - test_cli_golden: mask the tmp path in its JSON-escaped form, spell it the POSIX way, record on Linux, mask the protocol version (the recording had failed everywhere since the MNP 4.0 bump) and argparse's version-dependent quoting; point USERPROFILE at the tmp home, or `member invite` and `operator pair` wrote their codes into the developer's profile. - test_disk_io_off_loop: expect what a free loop can reach on the platform's timer, 15.6 ms on Windows, not an assumed 5 ms. - test_root_paths_are_operator_only: expect the OS's spelling of the path. - test_audio_meta_cache: find ffprobe with shutil.which. Node suite on Windows: 1489 passed, none failed. Hub suite: 3 failures left, all older than this change (two SQLite concurrency tests, one transfer resume). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.py4
1 files changed, 2 insertions, 2 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 e00f1cf..646c7b4 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
@@ -122,7 +122,7 @@ def test_the_cli_only_reads_fields_the_payload_carries(monkeypatch, tmp_path, ca
"groups": [{"id": gid, "roots": [_Recording(offered)]}]})
patch_cli(monkeypatch, "_resolve_group", lambda cfg, g: gid)
conf = tmp_path / "node.toml"
- conf.write_text('[hub]\nurl = "https://example.invalid"\n')
+ conf.write_text('[hub]\nurl = "https://example.invalid"\n', encoding="utf-8")
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"))
@@ -131,7 +131,7 @@ def test_the_cli_only_reads_fields_the_payload_carries(monkeypatch, tmp_path, ca
daemon_mod.main()
assert read, "the root CLI no longer reads the payload this way"
- assert "/tmp/x" in capsys.readouterr().out
+ assert str(Path("/tmp/x")) in capsys.readouterr().out
assert read <= set(offered), (
f"the `root` CLI reads keys the loopback payload does not carry: "
f"{sorted(read - set(offered))}")