[Test Improver] test: add unit tests for deps/_utils.py utility functions (0% -> ~95%)#696
Draft
danielmeppiel wants to merge 1 commit intomainfrom
Draft
Conversation
Cover the 7 previously-untested helpers in apm_cli/commands/deps/_utils.py: - _is_nested_under_package: nesting detection for rglob scan - _count_primitives: prompt/instruction/agent/skill/hook counting - _count_package_files: context + workflow file counting - _count_workflows: wrapper delegation - _get_detailed_context_counts: per-type context breakdown - _get_package_display_info: name/version display with fallbacks - _get_detailed_package_info: full package info dict with error handling 42 new tests, all passing. Full unit suite: 3866 passed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
🤖 Test Improver — automated AI assistant
Goal and Rationale
apm_cli/commands/deps/_utils.pycontains 7 utility helpers used by thedeps list,deps tree, anddeps infosubcommands to scan installed packages and count their primitive files. None of these helpers had direct unit tests despite being called in user-facing output paths.These are pure filesystem-manipulation functions with clear I/O contracts — ideal candidates for fast, deterministic unit tests.
Functions Covered
_is_nested_under_package_count_primitives_count_package_files_count_workflows_count_package_files_get_detailed_context_counts_get_package_display_infoname@versiondisplay string fromapm.yml_get_detailed_package_infoapm.ymlApproach
tmp_pathfixtures to build realistic package directory structures.apm/dir present with various primitives) and edge cases:.apm/dir — falls back to root-level filesapm.yml— returns error dict gracefullyapm.yml— uses directory name as fallback.prompt.mdfiles counted alongside.apm/prompts/SKILL.mdcounted as a skillCoverage Impact
deps/_utils.pyTest Status
Reproducibility