From 67523fae7c4dbf09dae64074b12550642539a656 Mon Sep 17 00:00:00 2001 From: joaomarcos Date: Sat, 20 Jun 2026 16:05:44 -0700 Subject: [PATCH] test(web_server): make profile-wrapper alias test OS-aware On Windows, hermes writes writer.bat (@echo off / hermes -p writer %*) with CRLF endings instead of the POSIX writer shell script. The test hardcoded the POSIX path and exact bytes, so it failed on Windows hosts. Assert on stripped non-empty lines per platform, making it line-ending- and OS-independent. --- tests/hermes_cli/test_web_server.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/hermes_cli/test_web_server.py b/tests/hermes_cli/test_web_server.py index 99969e29dc6..3ce5582619a 100644 --- a/tests/hermes_cli/test_web_server.py +++ b/tests/hermes_cli/test_web_server.py @@ -4,6 +4,7 @@ import asyncio import os import json import shutil +import sys from pathlib import Path from types import SimpleNamespace from unittest.mock import patch, MagicMock @@ -3005,9 +3006,14 @@ class TestNewEndpoints: ) assert resp.status_code == 200 - wrapper_path = wrapper_dir / "writer" + is_windows = sys.platform == "win32" + wrapper_path = wrapper_dir / ("writer.bat" if is_windows else "writer") assert wrapper_path.exists() - assert wrapper_path.read_text() == '#!/bin/sh\nexec /opt/hermes/bin/hermes -p writer "$@"\n' + lines = [line.strip() for line in wrapper_path.read_text().splitlines() if line.strip()] + if is_windows: + assert lines == ["@echo off", "hermes -p writer %*"] + else: + assert lines == ["#!/bin/sh", 'exec /opt/hermes/bin/hermes -p writer "$@"'] def test_profiles_create_with_clone_from_copies_source_skills(self, monkeypatch): from hermes_constants import get_hermes_home