Skip to content

test: cover repo_inspect parsers and PolicyHandler path/dedup helpers - #1164

Draft
madara88645 wants to merge 1 commit into
mainfrom
tests/add-repo-inspect-policy-coverage-20260730
Draft

test: cover repo_inspect parsers and PolicyHandler path/dedup helpers#1164
madara88645 wants to merge 1 commit into
mainfrom
tests/add-repo-inspect-policy-coverage-20260730

Conversation

@madara88645

Copy link
Copy Markdown
Owner

Summary

  • Adds direct unit tests for parse_package_json_scripts, parse_makefile_targets, and detect_stacks in app/repo_inspect/detect.py
  • Adds direct unit tests for PolicyHandler._has_explicit_path and PolicyHandler._unique in app/heuristics/handlers/policy.py

These pure, deterministic helpers were previously exercised only indirectly through test_repo_inspect.py / test_policy_handler.py's integration-style tests against derive_repo_context() / compile_text_v2(). Several edge cases had no direct assertion at all: malformed JSON in package.json, a non-dict scripts block, Makefile recipe-line/target boundary handling, and — notably — the ordering guarantee that cloud paths (s3://, gs://) are detected before the generic URL-stripping step in _has_explicit_path.

Only new test files were added; no source, config, or CI files were touched.

Test plan

  • pytest tests/test_repo_inspect_detect_functions.py tests/test_policy_handler_helpers.py tests/test_repo_inspect.py tests/test_policy_handler.py -q → 56 passed, 0 failed

Generated by Claude Code

…dler path/dedup helpers

Adds edge-case unit tests for parse_package_json_scripts, parse_makefile_targets,
and detect_stacks (app/repo_inspect/detect.py), and for PolicyHandler._has_explicit_path
and PolicyHandler._unique (app/heuristics/handlers/policy.py). These pure functions
were previously exercised only indirectly through integration tests, leaving edge
cases like malformed JSON, non-dict scripts blocks, Makefile recipe-line boundaries,
and cloud-path-before-URL-stripping ordering unverified in isolation.

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

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
compiler Ready Ready Preview Jul 30, 2026 4:17am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant