Fix empty tool selection persistence
This commit is contained in:
parent
666f2dd486
commit
d07d867718
2 changed files with 20 additions and 1 deletions
|
|
@ -308,7 +308,7 @@ def _get_platform_tools(config: dict, platform: str) -> Set[str]:
|
|||
platform_toolsets = config.get("platform_toolsets", {})
|
||||
toolset_names = platform_toolsets.get(platform)
|
||||
|
||||
if not toolset_names or not isinstance(toolset_names, list):
|
||||
if toolset_names is None or not isinstance(toolset_names, list):
|
||||
default_ts = PLATFORMS[platform]["default_toolset"]
|
||||
toolset_names = [default_ts]
|
||||
|
||||
|
|
|
|||
19
tests/hermes_cli/test_tools_config.py
Normal file
19
tests/hermes_cli/test_tools_config.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
"""Tests for hermes_cli.tools_config platform tool persistence."""
|
||||
|
||||
from hermes_cli.tools_config import _get_platform_tools
|
||||
|
||||
|
||||
def test_get_platform_tools_uses_default_when_platform_not_configured():
|
||||
config = {}
|
||||
|
||||
enabled = _get_platform_tools(config, "cli")
|
||||
|
||||
assert enabled
|
||||
|
||||
|
||||
def test_get_platform_tools_preserves_explicit_empty_selection():
|
||||
config = {"platform_toolsets": {"cli": []}}
|
||||
|
||||
enabled = _get_platform_tools(config, "cli")
|
||||
|
||||
assert enabled == set()
|
||||
Loading…
Add table
Add a link
Reference in a new issue