From d11e571c5b6c24b586ef5b8fb2cfcf6a6bfa6d6d Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Fri, 4 Sep 2026 02:20:57 +0200 Subject: test(node): make the suite pass on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - `.read_text()` on source files now `encoding="utf-8"` — cp1252 chokes on the em dashes / box-drawing chars those files contain. - test node.toml templates embed paths via `Path.as_posix()`: a raw Windows path in a basic TOML string is a parse error (`\U`, `\a`, ... are escapes). - new `test_platform.py` covers `meshbay_node.platform` by mocking `sys.platform` / `os.environ` — runs on both OSes. - `skipif(sys.platform == "win32")`, in `conftest.needs_subprocess` and inline, for the documented gaps: ffmpeg/ffprobe via asyncio subprocess (the win32 selector loop, forced for aiortc, cannot spawn one), the systemd `reload`/`restart-daemon` delegation (Windows path is W3), the keystore `st_mode == 600` assertion (NTFS ignores mode bits), and the symlink-escape test (needs Developer Mode). Windows: 781 passed, 25 skipped. No change on Linux. Co-Authored-By: Claude Sonnet 5 --- packages/meshbay-node/tests/test_keystore.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'packages/meshbay-node/tests/test_keystore.py') diff --git a/packages/meshbay-node/tests/test_keystore.py b/packages/meshbay-node/tests/test_keystore.py index b3c2b56..7dfefce 100644 --- a/packages/meshbay-node/tests/test_keystore.py +++ b/packages/meshbay-node/tests/test_keystore.py @@ -1,5 +1,7 @@ """Tests for meshbay_node.keystore.""" +import sys + import pytest from pathlib import Path from meshbay_node.keystore import ( @@ -22,7 +24,9 @@ def test_create_and_load(tmp_path): assert len(keys.pk_ed25519_b64) == 44 # 32 bytes → 44 base64 chars assert len(keys.pk_x25519_b64) == 44 assert path.exists() - assert oct(path.stat().st_mode)[-3:] == "600" + if sys.platform != "win32": + # NTFS ignores POSIX mode bits; chmod_private is a no-op there (W5). + assert oct(path.stat().st_mode)[-3:] == "600" loaded = load_keystore(path=path, password="testpass99") assert loaded.pk_ed25519_b64 == keys.pk_ed25519_b64 -- cgit v1.2.3