Compare commits

...

1 Commits

Author SHA1 Message Date
joaomarcos
5217636a76 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.
2026-06-20 16:05:44 -07:00

View File

@@ -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