mirror of
https://github.com/trustedsec/hate_crack.git
synced 2026-07-28 14:47:22 -07:00
feat(update): install system deps (transmission-daemon/p7zip) on upgrade
Add _install_system_deps() called by _run_upgrade() after a successful git pull. Installs transmission-daemon (Linux) or transmission-cli brew formula (macOS) so users who upgrade don't need to re-run make install manually. Also corrects _run_upgrade to exit 1 on failure. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
f43b0742a1
commit
e238c9bb66
@@ -153,7 +153,7 @@ class TestCheckForUpdates:
|
||||
"subprocess.run", side_effect=[git_root_proc, make_proc]
|
||||
) as mock_run, patch("shutil.which", return_value="/usr/local/bin/uv"), patch(
|
||||
"os.path.isfile", return_value=True
|
||||
), pytest.raises(
|
||||
), patch.object(hc_module, "_install_system_deps"), pytest.raises(
|
||||
SystemExit
|
||||
):
|
||||
mock_requests.get.return_value = mock_resp
|
||||
@@ -236,7 +236,9 @@ class TestRunUpgrade:
|
||||
make_proc = MagicMock()
|
||||
make_proc.returncode = 0
|
||||
|
||||
with patch("subprocess.run", side_effect=[git_root_proc, make_proc]) as mock_run, pytest.raises(SystemExit) as exc:
|
||||
with patch("subprocess.run", side_effect=[git_root_proc, make_proc]) as mock_run, \
|
||||
patch.object(hc_module, "_install_system_deps"), \
|
||||
pytest.raises(SystemExit) as exc:
|
||||
hc_module._run_upgrade()
|
||||
|
||||
assert exc.value.code == 0
|
||||
@@ -259,7 +261,7 @@ class TestRunUpgrade:
|
||||
with patch("subprocess.run", side_effect=[git_root_proc, make_proc]), pytest.raises(SystemExit) as exc:
|
||||
hc_module._run_upgrade()
|
||||
|
||||
assert exc.value.code == 0
|
||||
assert exc.value.code == 1
|
||||
output = capsys.readouterr().out
|
||||
assert "Upgrade failed" in output
|
||||
|
||||
|
||||
Reference in New Issue
Block a user