mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-11-22 23:22:18 +01:00
Write the 15-key manifest from scratch when none exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31 lines
924 B
Python
31 lines
924 B
Python
"""The external-binary check. Moved here from test_cli.py with the code it covers."""
|
|
|
|
import pytest
|
|
|
|
from steam_installer import deps
|
|
|
|
|
|
def test_nothing_missing_when_depotdownloader_is_on_path(monkeypatch):
|
|
monkeypatch.setattr(deps.shutil, "which", lambda name: f"/usr/bin/{name}")
|
|
assert deps.missing_tools() == []
|
|
deps.require()
|
|
|
|
|
|
def test_steamcmd_is_never_required(monkeypatch):
|
|
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):
|
|
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 "./install.sh" in message
|