From 0f2609fc52cd63b31b6f4c6ca039bc403c247b10 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Fri, 28 Aug 2026 19:38:25 +0200 Subject: [PATCH] One Python, always the newest; cover the credited-steamcmd branch Co-Authored-By: Claude Opus 5 (1M context) --- _installer_import/pyproject.toml | 2 +- _installer_import/tests/test_cli.py | 41 +++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/_installer_import/pyproject.toml b/_installer_import/pyproject.toml index 43b0307..a6609d3 100644 --- a/_installer_import/pyproject.toml +++ b/_installer_import/pyproject.toml @@ -2,7 +2,7 @@ name = "steam-game-installer" version = "0.1.0" description = "Fast Steam game installs: depotdownloader for speed, steamcmd for recognition." -requires-python = ">=3.11" +requires-python = ">=3.14" dependencies = [] [project.scripts] diff --git a/_installer_import/tests/test_cli.py b/_installer_import/tests/test_cli.py index 0170056..c460dfd 100644 --- a/_installer_import/tests/test_cli.py +++ b/_installer_import/tests/test_cli.py @@ -177,6 +177,47 @@ def test_clean_steamcmd_run_short_circuits(steam, monkeypatch): assert called == [] +def test_a_complete_install_after_a_failed_steamcmd_is_not_credited_to_it( + steam, monkeypatch, capsys +): + """A valid manifest does not mean steamcmd is why it is valid. + + steamcmd can fail to even log in while the install was already complete on + arrival. Reporting that as "finished cleanly" credits a step that did + nothing and hides a real authentication failure, so the non-zero exit has + to say so out loud. + """ + library, _ = steam + _stub_download(monkeypatch) + + def fake_validate(appid, username, logger): + (library.steamapps / "appmanifest_1771300.acf").write_text( + vdf.dumps( + "AppState", + { + "StateFlags": "4", + "installdir": "KingdomComeDeliverance2", + "InstalledDepots": {"1771303": {"manifest": "1"}}, + "BytesToDownload": "1", + "BytesDownloaded": "1", + }, + ) + ) + return recognize.ValidateResult(True, False, 5) + + monkeypatch.setattr(cli.recognize, "run_steamcmd_validate", fake_validate) + called = [] + monkeypatch.setattr( + cli.recognize, "finish_manifest_manually", lambda **kw: called.append(1) + ) + + assert cli.main(ARGV) == 0 + out = capsys.readouterr().out + assert "steamcmd exited 5" in out + assert "finished cleanly" not in out + assert called == [] + + def test_user_declining_confirmation_aborts(steam, monkeypatch): monkeypatch.setattr("builtins.input", lambda *a: "n") called = []