hermes-agent/tests/plugins/memory/test_hindsight_config_schema.py
Erosika 2a632807e0 refactor(memory): move provider config schemas into their plugins
Each provider now declares its config surface in config_schema.py inside
its own plugin dir (plugins/memory/<name>/), loaded by file path like the
plugins themselves so plugin __init__ imports never reach the web server.
hermes_cli/memory_providers.py is gone; the shared field primitives and
loader live in plugins/memory/config_schema.py, and the schema tests move
to tests/plugins/memory/ alongside the other per-plugin suites.
2026-07-02 16:55:39 -04:00

51 lines
1.5 KiB
Python

"""Tests for Hindsight's declared config surface."""
from plugins.memory.config_schema import (
KIND_SECRET,
KIND_SELECT,
get_provider_config_schema,
)
def test_hindsight_is_declared():
provider = get_provider_config_schema("hindsight")
assert provider is not None
assert provider.label == "Hindsight"
assert {field.key for field in provider.fields} == {
"mode",
"api_key",
"api_url",
"bank_id",
"recall_budget",
}
def test_fields_are_all_inline():
provider = get_provider_config_schema("hindsight")
assert provider is not None
# Hindsight is simple enough to render fully in the compact panel, so it
# never grows a Full config… modal.
assert all(field.inline for field in provider.fields)
def test_mode_gating_is_expressed_as_select_options():
provider = get_provider_config_schema("hindsight")
assert provider is not None
mode = next(field for field in provider.fields if field.key == "mode")
assert mode.kind == KIND_SELECT
assert mode.allowed_values() == {"cloud", "local_external"}
# local_embedded is intentionally unsupported on desktop.
assert "local_embedded" not in mode.allowed_values()
def test_api_key_is_a_secret_bound_to_env():
provider = get_provider_config_schema("hindsight")
assert provider is not None
api_key = next(field for field in provider.fields if field.key == "api_key")
assert api_key.kind == KIND_SECRET
assert api_key.is_secret is True
assert api_key.env_key == "HINDSIGHT_API_KEY"