Prepare dependency generations before selecting them. Keep shipped tool bytes separate from writable additions, and store facts beside their entries. Validate proposed plugin sets before config publication. Restore the previous config if the facts write fails. Consolidate duplicate updater, backup, setup, and voice helpers. Repair launcher selection, dependency consumers, download ownership, update feeds, and native Windows process and file handling. Verification: 206 changed/prior-failing Python files reported 4630 passed, one failed, and 330 skipped. Fix the remaining Hindsight fixture boundary. The final targeted rerun reported 234 passed and two skipped. The store review regression batch reported 83 passed and one skipped. Desktop TypeScript checks, 56 selected Electron tests, 24 release tests, and the removed-import/compatibility guards passed. This is an integration checkpoint, not full audit acceptance. The complete Python suite has not run on this fixed tree. Crash-atomic plugin publication, generation cleanup, receipt correlation, and packaged lifecycle acceptance remain open in docs/pm-audit-status.md.
43 lines
1.3 KiB
Python
43 lines
1.3 KiB
Python
"""Behavior tests for hermes_state._wal_reset_repair_hint.
|
|
|
|
The WAL-reset corruption warning's repair hint must match what the user's
|
|
install can actually do: source checkouts get the venv-setup step, packaged
|
|
installs get their steward's update command (#75153).
|
|
"""
|
|
|
|
from unittest.mock import patch
|
|
|
|
import hermes_state_wal as hermes_state
|
|
|
|
|
|
def _hint_for(method):
|
|
with patch("hermes_cli.config.detect_install_method", return_value=method), \
|
|
patch("hermes_cli.config.recommended_update_command_for_method",
|
|
return_value=f"CMD-{method}"):
|
|
return hermes_state._wal_reset_repair_hint()
|
|
|
|
|
|
def test_source_checkout_gets_venv_setup_hint():
|
|
assert _hint_for("source") == "CMD-source"
|
|
|
|
|
|
def test_git_install_gets_hermes_managed_hint():
|
|
assert _hint_for("git") == (
|
|
"Hermes-managed installs can repair the embedded runtime with `CMD-git`"
|
|
)
|
|
|
|
|
|
def test_docker_gets_container_image_hint():
|
|
assert _hint_for("docker") == "update the container image with `CMD-docker`"
|
|
|
|
|
|
def test_nix_passes_through_recommended_command():
|
|
assert _hint_for("nix") == "CMD-nix"
|
|
|
|
|
|
def test_hint_falls_back_when_detection_fails():
|
|
with patch("hermes_cli.config.detect_install_method",
|
|
side_effect=RuntimeError("boom")):
|
|
hint = hermes_state._wal_reset_repair_hint()
|
|
assert "SQLite 3.51.3+" in hint
|