Surfaced by Copilot review of #763.
The two test classes added in #763 — TestExplicitTargetDirCreation and TestContentHashFallback in tests/unit/test_install_command.py — re-implement the production conditional inline rather than exercising apm install itself. They will pass even if install/phases/targets.py or install/phases/{download,integrate}.py regress, defeating their purpose as regression guards.
Required follow-up
- Explicit target dir creation — invoke
apm install --target claude via CliRunner (mocking downloads/integration), assert .claude/ is created. Or factor the loop in install/phases/targets.py into a helper and unit-test the helper directly.
- Content-hash fallback — exercise the install flow with a mocked
git.Repo that raises and a mocked downloader; assert the downloader is not called when content_hash matches, and is called when it mismatches/is missing. Affects three sites:
install/phases/download.py:81-90
install/phases/integrate.py:104-114 (update_refs branch)
install/phases/integrate.py:115-126 (normal-mode branch)
Context
This aligns with the broader integration-coverage push in #767 — the cleanest fix is likely a shared CliRunner-based fixture under tests/integration/install/ rather than more isolated unit tests.
Acceptance criteria
- New tests fail if the
and not _explicit guard is removed from targets.py.
- New tests fail if the content-hash fallback in any of the 3 sites is replaced back with
pass.
Refs: #763 (Copilot review comments), #767 (integration coverage gaps).
Surfaced by Copilot review of #763.
The two test classes added in #763 —
TestExplicitTargetDirCreationandTestContentHashFallbackintests/unit/test_install_command.py— re-implement the production conditional inline rather than exercisingapm installitself. They will pass even ifinstall/phases/targets.pyorinstall/phases/{download,integrate}.pyregress, defeating their purpose as regression guards.Required follow-up
apm install --target claudeviaCliRunner(mocking downloads/integration), assert.claude/is created. Or factor the loop ininstall/phases/targets.pyinto a helper and unit-test the helper directly.git.Repothat raises and a mocked downloader; assert the downloader is not called whencontent_hashmatches, and is called when it mismatches/is missing. Affects three sites:install/phases/download.py:81-90install/phases/integrate.py:104-114(update_refs branch)install/phases/integrate.py:115-126(normal-mode branch)Context
This aligns with the broader integration-coverage push in #767 — the cleanest fix is likely a shared CliRunner-based fixture under
tests/integration/install/rather than more isolated unit tests.Acceptance criteria
and not _explicitguard is removed fromtargets.py.pass.Refs: #763 (Copilot review comments), #767 (integration coverage gaps).