Skip to content

test: add unit tests for 8 untested core modules#60

Merged
teknium1 merged 2 commits intoNousResearch:mainfrom
0xbyt4:test/expand-coverage
Feb 27, 2026
Merged

test: add unit tests for 8 untested core modules#60
teknium1 merged 2 commits intoNousResearch:mainfrom
0xbyt4:test/expand-coverage

Conversation

@0xbyt4
Copy link
Copy Markdown
Contributor

@0xbyt4 0xbyt4 commented Feb 26, 2026

Summary

  • Adds 210 new unit tests covering 8 previously untested modules
  • Total test suite: 380 passing, 0 failing
  • Increases coverage from ~10% to meaningful coverage of core logic

Modules Tested

Module Tests What's covered
cron/jobs.py 34 Schedule parsing (duration, interval, cron, ISO), job CRUD, due-job detection
tools/memory_tool.py 32 Security scanning (injection, exfil, unicode), MemoryStore add/replace/remove, persistence, dispatcher
toolsets.py 19 Toolset resolution, cycle detection, validation, custom toolsets, structural consistency
tools/file_operations.py 37 Write deny list, result dataclasses (ReadResult, WriteResult, etc.), shell helpers
agent/prompt_builder.py 24 Context injection scanning, content truncation, skill description parsing, context file discovery
agent/model_metadata.py 16 Token estimation, default context lengths, API fetch with cache mocking
hermes_state.py 28 SessionDB SQLite CRUD, FTS5 full-text search, export, prune, schema/WAL validation

Test plan

  • uv run pytest tests/ -v — 380 passed, 3 skipped (croniter optional), 0 failed
Add comprehensive test coverage for:
- cron/jobs.py: schedule parsing, job CRUD, due-job detection (34 tests)
- tools/memory_tool.py: security scanning, MemoryStore ops, dispatcher (32 tests)
- toolsets.py: resolution, validation, composition, cycle detection (19 tests)
- tools/file_operations.py: write deny list, result dataclasses, helpers (37 tests)
- agent/prompt_builder.py: context scanning, truncation, skills index (24 tests)
- agent/model_metadata.py: token estimation, context lengths (16 tests)
- hermes_state.py: SessionDB SQLite CRUD, FTS5 search, export, prune (28 tests)

Total: 210 new tests, all passing (380 total suite).
These tests documented the macOS symlink bypass bug with
platform-conditional assertions. The fix and proper regression
tests are in PR NousResearch#61 (tests/tools/test_write_deny.py), so remove
them here to avoid ordering conflicts between the two PRs.
@teknium1 teknium1 merged commit 274e623 into NousResearch:main Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants