Skip to content

[FEATURE] Extract skip_download logic into testable helpers #552

@sergio-sisternes-epam

Description

@sergio-sisternes-epam

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_download and locked_ref decision logic into shared helper functions used by both install.py and the tests, or
  • (b) Write integration-level unit tests that call _install_apm_dependencies() with GitHubPackageDownloader mocked (similar to tests/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.py referencing 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestneeds-triageNew issue, not yet reviewed by maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions