Add unit test coverage for existing modules #37

Open
opened 2026-04-06 22:54:36 +00:00 by mcp-service · 0 comments

Add tests/ directory with unittest-based coverage for all testable existing modules. No new dependencies — uses stdlib unittest and unittest.mock.

Modules covered:

  • cache.py — write/read/validate entries, confidence field validation, investigation ID
  • filetypes.py — extension classification, summarize_categories, classify_files
  • code.pydetect_languages, find_large_files (subprocess mocked)
  • disk.py_human_size, top_directories, get_disk_usage (subprocess mocked)
  • recency.pyfind_recent_files (subprocess mocked)
  • tree.pybuild_tree, render_tree, _human_size
  • report.pyformat_flags, format_report
  • capabilities.py_check_package

Skipped (not unit-testable without heavy deps or live services):

  • ai.py — requires Anthropic API
  • ast_parser.py — requires tree-sitter
  • watch.py — stateful filesystem events
  • prompts.py — string templates only

Also: update CLAUDE.md development workflow to require test coverage for all changes.

Add `tests/` directory with `unittest`-based coverage for all testable existing modules. No new dependencies — uses stdlib `unittest` and `unittest.mock`. **Modules covered:** - `cache.py` — write/read/validate entries, confidence field validation, investigation ID - `filetypes.py` — extension classification, `summarize_categories`, `classify_files` - `code.py` — `detect_languages`, `find_large_files` (subprocess mocked) - `disk.py` — `_human_size`, `top_directories`, `get_disk_usage` (subprocess mocked) - `recency.py` — `find_recent_files` (subprocess mocked) - `tree.py` — `build_tree`, `render_tree`, `_human_size` - `report.py` — `format_flags`, `format_report` - `capabilities.py` — `_check_package` **Skipped (not unit-testable without heavy deps or live services):** - `ai.py` — requires Anthropic API - `ast_parser.py` — requires tree-sitter - `watch.py` — stateful filesystem events - `prompts.py` — string templates only **Also:** update `CLAUDE.md` development workflow to require test coverage for all changes.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: archeious/luminos#37
No description provided.