fleet-memory/hindsight-integrations/hermes/tests/test_config.py
Ben ef90842f87
feat: hindsight-hermes integration for Hermes Agent (#600)
* feat: add hindsight-hermes integration for Hermes Agent

* chore: add Hermes docs page, icon, and release process bindings

- Add cookbook page for Hermes integration (synced with README)
- Add Hermes icon and map hindsight-hermes SDK tag in CookbookGrid
- Add cookbook entry to index.mdx
- Add hindsight-hermes to release.sh PYTHON_PACKAGES array
- Add build, publish, artifact upload, and release asset steps in release.yml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 18:06:55 +01:00

57 lines
1.7 KiB
Python

"""Tests for hindsight_hermes.config module."""
from hindsight_hermes.config import (
HindsightHermesConfig,
configure,
get_config,
reset_config,
)
class TestConfigure:
def setup_method(self):
reset_config()
def teardown_method(self):
reset_config()
def test_configure_returns_config(self):
cfg = configure(hindsight_api_url="http://localhost:8888", api_key="test-key")
assert isinstance(cfg, HindsightHermesConfig)
assert cfg.hindsight_api_url == "http://localhost:8888"
assert cfg.api_key == "test-key"
def test_configure_defaults(self):
cfg = configure()
assert cfg.hindsight_api_url == "https://api.hindsight.vectorize.io"
assert cfg.api_key is None
assert cfg.budget == "mid"
assert cfg.max_tokens == 4096
assert cfg.tags is None
assert cfg.recall_tags is None
assert cfg.recall_tags_match == "any"
assert cfg.verbose is False
def test_get_config_returns_none_before_configure(self):
assert get_config() is None
def test_get_config_returns_configured(self):
configure(api_key="k")
cfg = get_config()
assert cfg is not None
assert cfg.api_key == "k"
def test_reset_config(self):
configure(api_key="k")
reset_config()
assert get_config() is None
def test_configure_reads_env_var(self, monkeypatch):
monkeypatch.setenv("HINDSIGHT_API_KEY", "env-key")
cfg = configure()
assert cfg.api_key == "env-key"
def test_explicit_key_overrides_env(self, monkeypatch):
monkeypatch.setenv("HINDSIGHT_API_KEY", "env-key")
cfg = configure(api_key="explicit-key")
assert cfg.api_key == "explicit-key"