mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
test: reorganize test structure and add missing unit tests
Reorganize flat tests/ directory to mirror source code structure (tools/, gateway/, hermes_cli/, integration/). Add 11 new test files covering previously untested modules: registry, patch_parser, fuzzy_match, todo_tool, approval, file_tools, gateway session/config/ delivery, and hermes_cli config/models. Total: 147 unit tests passing, 9 integration tests gated behind pytest marker.
This commit is contained in:
parent
3c5bf5b9d8
commit
8fc28c34ce
24 changed files with 1066 additions and 16 deletions
38
tests/conftest.py
Normal file
38
tests/conftest.py
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
"""Shared fixtures for the hermes-agent test suite."""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
# Ensure project root is importable
|
||||
PROJECT_ROOT = Path(__file__).parent.parent
|
||||
if str(PROJECT_ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(PROJECT_ROOT))
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def tmp_dir(tmp_path):
|
||||
"""Provide a temporary directory that is cleaned up automatically."""
|
||||
return tmp_path
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def mock_config():
|
||||
"""Return a minimal hermes config dict suitable for unit tests."""
|
||||
return {
|
||||
"model": "test/mock-model",
|
||||
"toolsets": ["terminal", "file"],
|
||||
"max_turns": 10,
|
||||
"terminal": {
|
||||
"backend": "local",
|
||||
"cwd": "/tmp",
|
||||
"timeout": 30,
|
||||
},
|
||||
"compression": {"enabled": False},
|
||||
"memory": {"memory_enabled": False, "user_profile_enabled": False},
|
||||
"command_allowlist": [],
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue