Problem
Three modules have gaps in test coverage.
1. api/models/schemas.py - zero coverage for utility functions
The query-type helpers (is_valid_query_type, str_to_query_type, try_str_to_query_type) and the request validators on ChatRequest and ChatRequestWithFiles have no tests at all.
2. api/prompts/prompt_builder.py - log_context branch untested
The existing four tests all call build_prompt with log_context=None. The LOG_ANALYSIS_INSTRUCTION code path that was added in PR #89 has zero coverage.
3. api/tools/sanitizer.py - most regex patterns untested
Only the password and docker-login patterns are tested. The Bearer token, GitHub token (ghp_), private key block, client_secret, and api_key (colon separator) patterns have no tests.
Proposed fix
- 22 tests in a new
tests/unit/models/test_schemas.py
- 3 tests appended to
tests/unit/prompts/test_prompt_builder.py
- 5 tests appended to
tests/unit/tools/test_sanitizer.py
Problem
Three modules have gaps in test coverage.
1.
api/models/schemas.py- zero coverage for utility functionsThe query-type helpers (
is_valid_query_type,str_to_query_type,try_str_to_query_type) and the request validators onChatRequestandChatRequestWithFileshave no tests at all.2.
api/prompts/prompt_builder.py-log_contextbranch untestedThe existing four tests all call
build_promptwithlog_context=None. TheLOG_ANALYSIS_INSTRUCTIONcode path that was added in PR #89 has zero coverage.3.
api/tools/sanitizer.py- most regex patterns untestedOnly the password and docker-login patterns are tested. The Bearer token, GitHub token (
ghp_), private key block,client_secret, andapi_key(colon separator) patterns have no tests.Proposed fix
tests/unit/models/test_schemas.pytests/unit/prompts/test_prompt_builder.pytests/unit/tools/test_sanitizer.py