-
Notifications
You must be signed in to change notification settings - Fork 88
[FEATURE] Extract skip_download logic into testable helpers #552
Description
Is your feature request related to a problem? Please describe.
Unit tests for install skip-download logic (test_install_update_refs.py, added in #550) validate reimplemented helper functions that mirror install.py conditions, rather than exercising the production code paths directly. This means the test suite can pass even if the real condition in install.py changes but the mirrored helper is not updated.
Identified during Copilot review of #550.
Describe the solution you'd like
Either:
- (a) Extract the
skip_downloadandlocked_refdecision logic into shared helper functions used by bothinstall.pyand the tests, or - (b) Write integration-level unit tests that call
_install_apm_dependencies()withGitHubPackageDownloadermocked (similar totests/unit/test_install_command.py) to assert update behavior end-to-end without network access.
Option (a) is simpler but requires extracting logic from a closure. Option (b) provides stronger guarantees but requires more mock setup.
Describe alternatives you've considered
- Keep the current mirrored-logic approach (adequate for a 1-line boolean expression, and the tests document the expected truth table clearly).
- Add a comment in
install.pyreferencing the test file so maintainers know to update both.
Additional context
The current tests are functional and catch regressions in the condition semantics. This is a testing quality improvement, not a bug.
Related: #550