From 5ab04c764c937449352e1375c71fc8aec84996f2 Mon Sep 17 00:00:00 2001 From: Aoshi-Dev Date: Thu, 27 Aug 2026 13:56:47 +0530 Subject: [PATCH] test(hermes_cli): make test_default_path pass on native Windows TestGetHermesHome.test_default_path asserted ~/.hermes unconditionally, but the native Windows default is %LOCALAPPDATA%\hermes (see hermes_constants._get_platform_default_hermes_home). Branch the assertion by platform so the test passes everywhere. Salvaged from PR #96003 by @Aoshi-Dev (the parse-guard half of that PR was superseded by #96169); authorship preserved. --- tests/hermes_cli/test_config.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/hermes_cli/test_config.py b/tests/hermes_cli/test_config.py index 807a85c77c..d05507a562 100644 --- a/tests/hermes_cli/test_config.py +++ b/tests/hermes_cli/test_config.py @@ -1,6 +1,7 @@ """Tests for hermes_cli configuration management.""" import os +import sys from pathlib import Path from unittest.mock import patch @@ -37,7 +38,18 @@ class TestGetHermesHome: with patch.dict(os.environ, {}, clear=False): os.environ.pop("HERMES_HOME", None) home = get_hermes_home() - assert home == Path.home() / ".hermes" + if sys.platform == "win32": + # Windows default is %LOCALAPPDATA%\hermes — see + # hermes_constants._get_platform_default_hermes_home. + local_appdata = os.environ.get("LOCALAPPDATA", "").strip() + base = ( + Path(local_appdata) + if local_appdata + else Path.home() / "AppData" / "Local" + ) + assert home == base / "hermes" + else: + assert home == Path.home() / ".hermes" class TestEnsureHermesHome: