mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-22 10:32:00 +00:00
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.
This commit is contained in:
parent
15cfc2836f
commit
67523fae7c
1 changed files with 8 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue