test: add unit tests for 8 previously untested Python modules - #4
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
test: add unit tests for 8 previously untested Python modules#4devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Add comprehensive unit tests for all Python library modules in templates/spec-repo/bin/lib/ that had zero test coverage: - test_validate_tickets.py: registry loading, capability mismatch, norm - test_issue_contract.py: section extraction, placeholder detection, impl plan analysis - test_extract_issue_sections.py: section/JSON block extraction, main output - test_validate_issue_body.py: body validation at fanout/expand/orchestrate levels - test_toposort_tickets.py: topological sort with deps, cycles, unknown refs - test_extract_task_meta.py: task block extraction for YAML and JSON fences - test_validate_prd_frontmatter.py: frontmatter validation integration tests - test_prd_io.py: PRD loading, CLI commands (tickets_json, slices_json, get) - test_task_meta_to_yaml.py: meta-to-YAML conversion, field filtering Total: 91 new test cases across 8 files. All pass alongside existing tests. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds 91 unit tests across 8 new test files for every Python module in
templates/spec-repo/bin/lib/that previously had zero test coverage.Coverage before: 3 modules tested (
existing_issue.py,migrate_repos_registry.py,read_spec_repo.sh)Coverage after: All 11 testable modules now have tests.
New test files
test_validate_tickets.pyvalidate_tickets.pyload_registry,_parse_repos_minimal,norm,capability_mismatchtest_issue_contract.pyissue_contract.pyextract_section,is_placeholder,implementation_plan_text,has_substantive_impl_planningtest_extract_issue_sections.pyextract_issue_sections.pysection,extract_json_block,is_placeholder,main()outputtest_validate_issue_body.pyvalidate_issue_body.pyvalidate()at fanout/expand/orchestrate levels, meta extraction, stage validationtest_toposort_tickets.pytoposort_tickets.pytest_extract_task_meta.pyextract_task_meta.pyparse_task_metaedge casestest_validate_prd_frontmatter.pyvalidate_prd_frontmatter.pyextract_frontmatter, CLI integration (valid/missing fields/empty tickets/missing file)test_prd_io.pyprd_io.pyextract_frontmatter,load_prd, CLI commands (tickets_json,tickets_count,slices_json,get)test_task_meta_to_yaml.pytask_meta_to_yaml.pydepends_ondefault, non-dict rejection, stagesAll tests use
unittest(matching existing conventions) and run without external dependencies beyond PyYAML.Link to Devin session: https://app.devin.ai/sessions/d6ac87688fa8429f83c530ec59d396c3
Requested by: @roborew