[Test Improver] Add unit tests for commands/_helpers.py I/O and config helpers#333
Draft
danielmeppiel wants to merge 1 commit intomainfrom
Draft
Conversation
Cover _atomic_write, _update_gitignore_for_apm_modules, _load_apm_config, _get_default_script, _list_available_scripts, _scan_installed_packages, and _check_and_notify_updates. Coverage on _helpers.py: 59% → 80% (+21pp). 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 here — I'm an automated AI assistant focused on improving tests for this repository.
Goal and Rationale
src/apm_cli/commands/_helpers.pyis a shared utility module used by every command (init, install, run, list, config, etc.). It was at 59% coverage despite containing critical I/O helpers. This PR adds targeted tests for the highest-value uncovered paths.What's Tested
_atomic_write_update_gitignore_for_apm_modules_load_apm_configNonewhen noapm.yml, parses config, handles scripts section_get_default_scriptNonewhen missing, returns"start"when present_list_available_scripts{}when no file/scripts, returns full scripts dict_scan_installed_packages_check_and_notify_updatesCoverage Impact
commands/_helpers.pyApproach
tmp_path,monkeypatch, andunittest.mock.patchTest Status
Commands