mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-11-23 11:06:18 +01:00
The installer ships as the steam_installer package beside steam_backlog_enforcer, with its tests, docs and Proton lock. The enforcer's fast install now starts the installer from this checkout. Both appinfo.vdf readers share one key-value decoder (steam_installer.appinfo_kv), and the duplicated test fixtures and helpers are folded into conftest and _cli_helpers so the whole-tree duplicate-code check is clean. check_requirements_sync treats sibling packages as first-party. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WzxdWZCxnNWLtpVwFLVk9w
40 lines
1.2 KiB
Python
40 lines
1.2 KiB
Python
"""The external-binary check. Moved here from test_cli.py with the code it covers."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
from steam_installer import deps
|
|
|
|
|
|
def test_nothing_missing_when_depotdownloader_is_on_path(
|
|
monkeypatch: pytest.MonkeyPatch,
|
|
) -> None:
|
|
"""Nothing missing when depotdownloader is on path."""
|
|
monkeypatch.setattr(deps.shutil, "which", lambda name: f"/usr/bin/{name}")
|
|
assert deps.missing_tools() == []
|
|
deps.require()
|
|
|
|
|
|
def test_steamcmd_is_never_required(monkeypatch: pytest.MonkeyPatch) -> None:
|
|
"""Steamcmd is never required."""
|
|
monkeypatch.setattr(
|
|
deps.shutil, "which", lambda name: None if name == "steamcmd" else "/usr/bin/dd"
|
|
)
|
|
assert deps.missing_tools() == []
|
|
|
|
|
|
def test_missing_tool_raises_with_the_command_that_fixes_it(
|
|
monkeypatch: pytest.MonkeyPatch,
|
|
) -> None:
|
|
"""Missing tool raises with the command that fixes it."""
|
|
monkeypatch.setattr(deps.shutil, "which", lambda name: None)
|
|
|
|
with pytest.raises(deps.DependencyError) as excinfo:
|
|
deps.require()
|
|
|
|
message = str(excinfo.value)
|
|
assert "depotdownloader" in message
|
|
assert "steamcmd" not in message
|
|
assert "steam_installer/install_deps.sh" in message
|