mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-11-23 16:26: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
36 lines
1.1 KiB
Python
36 lines
1.1 KiB
Python
"""Which processes keep the native Proton in use."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
from steam_installer import proton_native
|
|
|
|
if TYPE_CHECKING:
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
|
|
def test_in_use_sees_steam_and_processes_running_from_the_tool(
|
|
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
|
) -> None:
|
|
"""In use sees steam and processes running from the tool."""
|
|
proc = tmp_path / "proc"
|
|
tool = tmp_path / "tool"
|
|
(tool / "files/bin").mkdir(parents=True)
|
|
(tool / "files/bin/wine").write_text("")
|
|
(tmp_path / "other").write_text("")
|
|
for pid, target in (
|
|
("10", tool / "files/bin/wine"),
|
|
("11", tmp_path / "other"),
|
|
("13", tmp_path / "gone"),
|
|
):
|
|
(proc / pid).mkdir(parents=True)
|
|
(proc / pid / "exe").symlink_to(target)
|
|
(proc / "self").mkdir()
|
|
(proc / "12").mkdir()
|
|
monkeypatch.setattr(proton_native.recognize, "PROC_DIR", proc)
|
|
monkeypatch.setattr(proton_native.recognize, "steam_client_pids", lambda: [99])
|
|
assert proton_native.in_use(tool) == [99, 10]
|