mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-11-28 18:29:15 +01:00
Compare commits
No commits in common. "bbc3853c67adab05188f15b063dae6f93c22c0eb" and "edfd4861584e272777905649c77b0df7ea6ab5b9" have entirely different histories.
bbc3853c67
...
edfd486158
@ -115,7 +115,7 @@ repos:
|
||||
# PYLINT
|
||||
# ===========================================================================
|
||||
- repo: https://github.com/pylint-dev/pylint
|
||||
rev: v4.0.9
|
||||
rev: v4.0.8
|
||||
hooks:
|
||||
- id: pylint
|
||||
exclude: ^scripts/file_length/
|
||||
|
||||
@ -9,7 +9,7 @@ howlongtobeatpy==1.0.23
|
||||
mcp==2.2.0
|
||||
mypy==2.3.1
|
||||
pre-commit==4.6.2
|
||||
pylint==4.0.9
|
||||
pylint==4.0.8
|
||||
pytest==9.1.1
|
||||
pytest-cov==7.1.0
|
||||
pytest-randomly==5.0.0
|
||||
@ -17,6 +17,6 @@ pytest-sugar==1.1.1
|
||||
pytest-timeout==2.4.0
|
||||
pytest-xdist==3.8.0
|
||||
requests==2.34.2
|
||||
ruff==0.16.9
|
||||
ruff==0.16.8
|
||||
types-requests==2.33.0.20260906
|
||||
websockets==17.1
|
||||
|
||||
@ -24,7 +24,7 @@ from steam_backlog_enforcer._allowed_games import (
|
||||
# accessible normally; this only needs to list names imported-then-reexported.
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from steam_backlog_enforcer.config import Config, State
|
||||
from steam_backlog_enforcer.config import State
|
||||
|
||||
# How long an abandoned pick stays out of the auto-assignment pool, so that
|
||||
# ``scan`` does not immediately hand back the game the user just rejected.
|
||||
@ -93,15 +93,6 @@ def manual_pick_slots_left(state: State, max_picks: int) -> int:
|
||||
return max(0, max_picks - len(active_manual_picks(state)))
|
||||
|
||||
|
||||
def apply_configured_pick(
|
||||
config: Config, state: State, app_id: int, game_name: str
|
||||
) -> str | None:
|
||||
""":func:`apply_manual_pick` under the cap the configuration sets."""
|
||||
return apply_manual_pick(
|
||||
state, app_id, game_name, max_picks=config.max_manual_picks
|
||||
)
|
||||
|
||||
|
||||
def apply_manual_pick(
|
||||
state: State,
|
||||
app_id: int,
|
||||
|
||||
@ -16,11 +16,11 @@ from steam_backlog_enforcer._cmd_done import (
|
||||
_refresh_uncached_shortlist_hours,
|
||||
_report_assigned_confidence,
|
||||
)
|
||||
from steam_backlog_enforcer._enforce_loop import get_all_owned_app_ids
|
||||
from steam_backlog_enforcer._hltb_cached import fetch_hltb_times_cached
|
||||
from steam_backlog_enforcer._hltb_types import load_hltb_cache
|
||||
from steam_backlog_enforcer._pick_completion import mark_finished
|
||||
from steam_backlog_enforcer._snapshot import load_snapshot
|
||||
from steam_backlog_enforcer._steam_state import is_game_fully_installed
|
||||
from steam_backlog_enforcer.enforcer import (
|
||||
enforce_allowed_game,
|
||||
send_notification,
|
||||
@ -28,9 +28,10 @@ from steam_backlog_enforcer.enforcer import (
|
||||
from steam_backlog_enforcer.game_install import (
|
||||
_echo,
|
||||
install_game,
|
||||
is_game_installed,
|
||||
uninstall_other_games,
|
||||
)
|
||||
from steam_backlog_enforcer.library_hider import hide_others_and_report
|
||||
from steam_backlog_enforcer.library_hider import try_hide_other_games
|
||||
from steam_backlog_enforcer.scanning import pick_next_game
|
||||
from steam_backlog_enforcer.steam_api import GameInfo, SteamAPIClient
|
||||
|
||||
@ -72,9 +73,15 @@ def _finalize_completion(
|
||||
_echo(" No more games to assign!")
|
||||
return
|
||||
|
||||
hide_others_and_report(config, state)
|
||||
owned_ids = get_all_owned_app_ids(config)
|
||||
if owned_ids:
|
||||
hidden, skipped = try_hide_other_games(owned_ids, allowed_app_ids(state))
|
||||
if skipped is not None:
|
||||
_echo(f"\n Library hiding: skipped ({skipped})")
|
||||
elif hidden > 0:
|
||||
_echo(f"\n Library: hid {hidden} games")
|
||||
|
||||
if not is_game_fully_installed(state.current_app_id):
|
||||
if not is_game_installed(state.current_app_id):
|
||||
logger.info(
|
||||
"Assigned game still missing after library reconciliation; "
|
||||
"re-triggering install"
|
||||
@ -120,7 +127,7 @@ def _enforce_on_done(config: Config, state: State) -> None:
|
||||
if count:
|
||||
_echo(f" Uninstalled {count} unauthorized game(s)")
|
||||
|
||||
if not is_game_fully_installed(state.current_app_id):
|
||||
if not is_game_installed(state.current_app_id):
|
||||
_echo(f" Re-installing {state.current_game_name}...")
|
||||
install_game(
|
||||
state.current_app_id,
|
||||
@ -132,7 +139,13 @@ def _enforce_on_done(config: Config, state: State) -> None:
|
||||
# Reconcile library: hide non-assigned games and unhide the assigned one.
|
||||
# Without this, an interrupted earlier completion can leave the new
|
||||
# assigned game hidden and stale games visible.
|
||||
hide_others_and_report(config, state, lead=" ")
|
||||
owned_ids = get_all_owned_app_ids(config)
|
||||
if owned_ids:
|
||||
hidden, skipped = try_hide_other_games(owned_ids, allowed_app_ids(state))
|
||||
if skipped is not None:
|
||||
_echo(f" Library hiding: skipped ({skipped})")
|
||||
elif hidden > 0:
|
||||
_echo(f" Library: hid {hidden} games")
|
||||
|
||||
|
||||
def cmd_done(config: Config, state: State) -> None:
|
||||
|
||||
@ -12,13 +12,9 @@ from typing import TYPE_CHECKING
|
||||
|
||||
from steam_backlog_enforcer._actions import allowed_app_ids, allowed_games
|
||||
from steam_backlog_enforcer._echo import _echo
|
||||
from steam_backlog_enforcer._fast_install import poll_fast_installs
|
||||
from steam_backlog_enforcer._owned_apps_cache import get_all_owned_app_ids
|
||||
from steam_backlog_enforcer._steam_client import is_game_installed
|
||||
from steam_backlog_enforcer._steam_state import (
|
||||
is_game_fully_installed,
|
||||
steam_library_ready,
|
||||
)
|
||||
from steam_backlog_enforcer._steam_state import steam_library_ready
|
||||
from steam_backlog_enforcer.enforcer import send_notification
|
||||
from steam_backlog_enforcer.game_install import install_game
|
||||
from steam_backlog_enforcer.game_uninstall import uninstall_other_games
|
||||
@ -45,9 +41,6 @@ def _reinstall_missing_allowed(config: Config, state: State) -> None:
|
||||
if not steam_library_ready():
|
||||
return
|
||||
|
||||
# Reap/stall-check a detached fast install every pass: the game it is
|
||||
# installing may already have a manifest, so install_game never runs.
|
||||
poll_fast_installs()
|
||||
for app_id, name in allowed_games(state):
|
||||
if is_game_installed(app_id):
|
||||
continue
|
||||
@ -90,7 +83,7 @@ def _enforce_auto_install(config: Config, state: State) -> None:
|
||||
state: Current enforcer state.
|
||||
"""
|
||||
for app_id, name in allowed_games(state):
|
||||
if is_game_fully_installed(app_id):
|
||||
if is_game_installed(app_id):
|
||||
_echo(f" Allowed game already installed: {name}")
|
||||
continue
|
||||
_echo(f" Auto-installing {name}...")
|
||||
|
||||
@ -1,237 +0,0 @@
|
||||
"""Installing games through steam-game-installer, for download speed.
|
||||
|
||||
depotdownloader saturates the link far better than the Steam client, and
|
||||
steam-game-installer (``~/src/steam-game-installer``) wraps it so Steam accepts
|
||||
the result as a real install. It also adopts whatever Steam already staged, so
|
||||
taking over a slow client download loses nothing.
|
||||
|
||||
Two modes, picked by whether anyone can answer a prompt:
|
||||
|
||||
* **Foreground** (stdin is a terminal - ``pick-manual``, ``done``...): run to
|
||||
completion with the terminal attached, so depotdownloader's progress shows
|
||||
and a password / Steam Guard prompt can be answered.
|
||||
* **Detached** (the daemon): spawn in its own session and return. Every later
|
||||
pass reaps it through :func:`poll_fast_installs`, which records a failure (so
|
||||
the caller falls back to ``steam://install``) and interrupts a run whose
|
||||
output has stalled - most likely a login prompt nobody will ever answer,
|
||||
sitting there with Steam shut down.
|
||||
|
||||
The installer closes Steam to do its work, so it is refused outright while a
|
||||
game is running or another app is mid-update (the AoE2 corruption case).
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
import logging
|
||||
import os
|
||||
from pathlib import Path
|
||||
import pwd
|
||||
import re
|
||||
import shutil
|
||||
import signal
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
from steam_backlog_enforcer import config as _config
|
||||
from steam_backlog_enforcer._desktop_env import desktop_user_cmd, resolve_desktop_user
|
||||
from steam_backlog_enforcer._echo import _echo
|
||||
from steam_backlog_enforcer._steam_restart_guard import game_is_running
|
||||
from steam_backlog_enforcer._steam_state import (
|
||||
STEAMAPPS_PATH,
|
||||
steam_update_in_progress,
|
||||
)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
_INSTALLER = Path("src", "steam-game-installer", "run.sh")
|
||||
_INSTALLER_LOG = "~/.local/state/steam-game-installer/latest.log"
|
||||
# Depot content only: the app itself is ours to choose, the language is not
|
||||
# worth a prompt nobody is there to answer.
|
||||
_LANGUAGE = "english"
|
||||
# depotdownloader prints a line per finished chunk, so a healthy download is
|
||||
# never silent this long; a login prompt waiting on /dev/null is.
|
||||
STALL_SECONDS = 15 * 60
|
||||
|
||||
|
||||
@dataclass
|
||||
class _DetachedRun:
|
||||
"""A daemon-spawned installer run, kept so it can be reaped."""
|
||||
|
||||
app_id: int
|
||||
proc: subprocess.Popen[bytes]
|
||||
log_path: Path
|
||||
|
||||
|
||||
_RUNS: list[_DetachedRun] = []
|
||||
# Apps whose installer run failed in this process. They go straight to the
|
||||
# steam:// fallback from then on, so a broken login cannot close Steam on
|
||||
# every 3-second pass.
|
||||
_FAILED: set[int] = set()
|
||||
|
||||
|
||||
def _installer_path(user: str | None) -> Path | None:
|
||||
"""steam-game-installer's ``run.sh`` in the desktop user's home, if present.
|
||||
|
||||
Resolved from the passwd entry rather than ``Path.home()``: the daemon runs
|
||||
as root, and the installer, its venv and its credentials are per-user.
|
||||
"""
|
||||
try:
|
||||
home = Path(pwd.getpwnam(user).pw_dir) if user else Path.home()
|
||||
except KeyError:
|
||||
return None
|
||||
path = home / _INSTALLER
|
||||
return path if path.is_file() else None
|
||||
|
||||
|
||||
def _steam_account_name() -> str | None:
|
||||
"""The account Steam itself last signed in with, from ``loginusers.vdf``.
|
||||
|
||||
Read from Steam's own state rather than a copy in the enforcer config, so
|
||||
it cannot drift from the account that actually owns the games.
|
||||
"""
|
||||
path = STEAMAPPS_PATH.parent / "config" / "loginusers.vdf"
|
||||
try:
|
||||
content = path.read_text(encoding="utf-8", errors="replace")
|
||||
except OSError:
|
||||
return None
|
||||
match = re.search(r'"AccountName"\s+"([^"]+)"', content)
|
||||
return match.group(1) if match else None
|
||||
|
||||
|
||||
def _refusal(app_id: int) -> str | None:
|
||||
"""Why closing Steam right now would do damage, or None if it is safe."""
|
||||
if game_is_running():
|
||||
return "a game is running and closing Steam would kill it"
|
||||
if steam_update_in_progress(exclude_app_id=app_id):
|
||||
return (
|
||||
"another Steam download is in progress and closing Steam could corrupt it"
|
||||
)
|
||||
return None
|
||||
|
||||
|
||||
def _build_cmd(installer: Path, app_id: int, user: str | None) -> list[str]:
|
||||
"""The installer invocation, dropped to the desktop user when root."""
|
||||
cmd = [
|
||||
str(installer),
|
||||
# install.sh reaches for yay; dependencies are installed once, by hand.
|
||||
"--no-deps",
|
||||
"--appid",
|
||||
str(app_id),
|
||||
"--yes",
|
||||
"--language",
|
||||
_LANGUAGE,
|
||||
# Finishes the manifest from depotdownloader's own data, under the same
|
||||
# fail-closed checks: no second login, no 70 GB re-hash by steamcmd.
|
||||
"--skip-steamcmd",
|
||||
]
|
||||
account = _steam_account_name()
|
||||
if account:
|
||||
cmd += ["--username", account]
|
||||
return desktop_user_cmd(cmd, user)
|
||||
|
||||
|
||||
def is_fast_installing(app_id: int) -> bool:
|
||||
"""Whether this process has a live detached installer run for *app_id*."""
|
||||
return any(run.app_id == app_id for run in _RUNS)
|
||||
|
||||
|
||||
def _stalled(run: _DetachedRun) -> bool:
|
||||
"""Whether a live run has printed nothing for :data:`STALL_SECONDS`."""
|
||||
try:
|
||||
return time.time() - run.log_path.stat().st_mtime > STALL_SECONDS
|
||||
except OSError:
|
||||
return False
|
||||
|
||||
|
||||
def poll_fast_installs() -> None:
|
||||
"""Reap finished detached runs and interrupt stalled ones.
|
||||
|
||||
SIGINT, not SIGTERM: the installer turns it into KeyboardInterrupt, and its
|
||||
``finally`` restarts the Steam client it shut down. SIGTERM would leave
|
||||
Steam closed.
|
||||
"""
|
||||
for run in list(_RUNS):
|
||||
returncode = run.proc.poll()
|
||||
if returncode is None:
|
||||
if _stalled(run):
|
||||
logger.warning(
|
||||
"steam-game-installer for AppID=%d silent for %ds — "
|
||||
"interrupting (see %s).",
|
||||
run.app_id,
|
||||
STALL_SECONDS,
|
||||
run.log_path,
|
||||
)
|
||||
os.killpg(run.proc.pid, signal.SIGINT)
|
||||
continue
|
||||
_RUNS.remove(run)
|
||||
if returncode == 0:
|
||||
logger.info("steam-game-installer finished AppID=%d.", run.app_id)
|
||||
continue
|
||||
_FAILED.add(run.app_id)
|
||||
logger.warning(
|
||||
"steam-game-installer failed for AppID=%d (exit %d); falling back "
|
||||
"to Steam's own download. Log: %s",
|
||||
run.app_id,
|
||||
returncode,
|
||||
run.log_path,
|
||||
)
|
||||
|
||||
|
||||
def _spawn_detached(cmd: list[str], app_id: int) -> None:
|
||||
"""Start the installer in its own session, output to a log file."""
|
||||
log_path = _config.CONFIG_DIR / "fast_install.log"
|
||||
log_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
# The unit is KillMode=control-group: restarting the daemon would SIGTERM
|
||||
# an installer left in its cgroup, skipping the `finally` that restarts
|
||||
# Steam. A transient scope moves it out; --scope execs in place, so the
|
||||
# Popen pid below is still the session leader killpg needs.
|
||||
if os.geteuid() == 0 and shutil.which("systemd-run"):
|
||||
cmd = ["systemd-run", "--scope", "--quiet", "--collect", *cmd]
|
||||
with log_path.open("ab") as log:
|
||||
proc = subprocess.Popen(
|
||||
cmd,
|
||||
stdin=subprocess.DEVNULL,
|
||||
stdout=log,
|
||||
stderr=subprocess.STDOUT,
|
||||
start_new_session=True,
|
||||
)
|
||||
_RUNS.append(_DetachedRun(app_id, proc, log_path))
|
||||
logger.info("Started steam-game-installer for AppID=%d (log: %s)", app_id, log_path)
|
||||
|
||||
|
||||
def fast_install(app_id: int, label: str) -> bool:
|
||||
"""Install *app_id* with steam-game-installer.
|
||||
|
||||
Returns:
|
||||
True if the game was installed (foreground) or the run was started
|
||||
(detached); False if the caller should fall back to Steam's download.
|
||||
"""
|
||||
if app_id in _FAILED:
|
||||
return False
|
||||
user = resolve_desktop_user()
|
||||
installer = _installer_path(user)
|
||||
if installer is None:
|
||||
logger.warning("steam-game-installer not found; using Steam's download.")
|
||||
return False
|
||||
reason = _refusal(app_id)
|
||||
if reason is not None:
|
||||
_echo(f" Fast install of {label} skipped: {reason}.")
|
||||
return False
|
||||
|
||||
cmd = _build_cmd(installer, app_id, user)
|
||||
if not sys.stdin.isatty():
|
||||
_spawn_detached(cmd, app_id)
|
||||
return True
|
||||
|
||||
_echo(f" Fast-installing {label} with steam-game-installer (Steam will close)...")
|
||||
returncode = subprocess.run(cmd, check=False).returncode
|
||||
if returncode == 0:
|
||||
return True
|
||||
_FAILED.add(app_id)
|
||||
_echo(
|
||||
f" steam-game-installer failed (exit {returncode}); falling back to "
|
||||
f"Steam's own download. Log: {_INSTALLER_LOG}"
|
||||
)
|
||||
return False
|
||||
@ -12,7 +12,7 @@ from typing import Any
|
||||
from steam_backlog_enforcer._actions import (
|
||||
ABANDON_COOLDOWN_DAYS,
|
||||
active_manual_picks,
|
||||
apply_configured_pick,
|
||||
apply_manual_pick,
|
||||
find_manual_pick,
|
||||
)
|
||||
from steam_backlog_enforcer._allowed_games import MANUAL_LOCK_DAYS
|
||||
@ -71,7 +71,12 @@ def pick_manual(app_id: int, *, confirm: bool = False) -> dict[str, Any]:
|
||||
# Free the slots of picks already at 100%, so the cap below cannot refuse
|
||||
# on behalf of a game that is finished. Matches the CLI's pick-manual.
|
||||
retired = retire_completed_manual_picks(config, state)
|
||||
refused = apply_configured_pick(config, state, app_id, game_name)
|
||||
refused = apply_manual_pick(
|
||||
state,
|
||||
app_id,
|
||||
game_name,
|
||||
max_picks=config.max_manual_picks,
|
||||
)
|
||||
if refused is not None:
|
||||
return {"ok": False, "reason": refused}
|
||||
logger.info("pick_manual applied: %s (AppID=%s)", game_name, app_id)
|
||||
|
||||
@ -31,7 +31,7 @@ from typing import TYPE_CHECKING
|
||||
|
||||
from mcp.server import MCPServer
|
||||
|
||||
from steam_backlog_enforcer._snapshot import snapshot_game_name
|
||||
from steam_backlog_enforcer._snapshot import load_snapshot
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from steam_backlog_enforcer.steam_api import GameInfo
|
||||
@ -63,7 +63,12 @@ def _resolve_game_name(app_id: int) -> str | None:
|
||||
Returns:
|
||||
The game name, or ``None`` if not present in the snapshot.
|
||||
"""
|
||||
return snapshot_game_name(app_id)
|
||||
snapshot = load_snapshot()
|
||||
if snapshot:
|
||||
for entry in snapshot:
|
||||
if entry.get("app_id") == app_id:
|
||||
return str(entry["name"])
|
||||
return None
|
||||
|
||||
|
||||
def _backlog_sort_key(game: GameInfo) -> tuple[int, float]:
|
||||
|
||||
@ -19,10 +19,10 @@ from steam_backlog_enforcer._scanning_confidence import (
|
||||
_apply_cached_confidence_to_candidates,
|
||||
_report_poll_confidence,
|
||||
)
|
||||
from steam_backlog_enforcer._steam_state import is_game_fully_installed
|
||||
from steam_backlog_enforcer.game_install import (
|
||||
_echo,
|
||||
install_game,
|
||||
is_game_installed,
|
||||
uninstall_other_games,
|
||||
)
|
||||
|
||||
@ -93,7 +93,7 @@ def _assign_chosen_game(
|
||||
count = uninstall_other_games(allowed_app_ids(state))
|
||||
if count:
|
||||
_echo(f"\n Uninstalled {count} non-assigned games")
|
||||
if not is_game_fully_installed(chosen.app_id):
|
||||
if not is_game_installed(chosen.app_id):
|
||||
_echo(f"\n Auto-installing {chosen.name}...")
|
||||
install_game(
|
||||
chosen.app_id, chosen.name, config.steam_id, use_steam_protocol=True
|
||||
|
||||
@ -11,8 +11,6 @@ import json
|
||||
from typing import Any
|
||||
|
||||
from steam_backlog_enforcer import config
|
||||
from steam_backlog_enforcer._echo import _echo
|
||||
from steam_backlog_enforcer._steam_models import GameInfo
|
||||
from steam_backlog_enforcer.config import _atomic_write
|
||||
|
||||
|
||||
@ -40,20 +38,3 @@ def load_snapshot() -> list[dict[str, Any]] | None:
|
||||
)
|
||||
return result
|
||||
return None
|
||||
|
||||
|
||||
def snapshot_game_name(app_id: int) -> str | None:
|
||||
"""The name the last snapshot recorded for ``app_id``, or ``None``."""
|
||||
for entry in load_snapshot() or []:
|
||||
if entry.get("app_id") == app_id:
|
||||
return str(entry["name"])
|
||||
return None
|
||||
|
||||
|
||||
def require_snapshot_games() -> list[GameInfo] | None:
|
||||
"""The last snapshot as games, or ``None`` after telling the user to scan."""
|
||||
snapshot = load_snapshot()
|
||||
if snapshot is None:
|
||||
_echo("No snapshot found. Run 'scan' first.")
|
||||
return None
|
||||
return [GameInfo.from_snapshot(d) for d in snapshot]
|
||||
|
||||
@ -8,7 +8,7 @@ from typing import TYPE_CHECKING
|
||||
from steam_backlog_enforcer._hltb_types import (
|
||||
_read_raw_cache,
|
||||
)
|
||||
from steam_backlog_enforcer._snapshot import require_snapshot_games
|
||||
from steam_backlog_enforcer._snapshot import load_snapshot
|
||||
from steam_backlog_enforcer._stats_display import (
|
||||
_format_completion_date,
|
||||
_print_pace_scenario,
|
||||
@ -28,6 +28,9 @@ from steam_backlog_enforcer._web_dataset import (
|
||||
count_complete_since_start,
|
||||
)
|
||||
from steam_backlog_enforcer.game_install import _echo
|
||||
from steam_backlog_enforcer.steam_api import (
|
||||
GameInfo,
|
||||
)
|
||||
|
||||
# _GameTimes lives in the _stats_types leaf so both this module and its
|
||||
# helper modules can share it; it is re-exported here because callers (and
|
||||
@ -132,10 +135,12 @@ def cmd_stats(_config: Config, state: State) -> None:
|
||||
4. Worst — absolute maximum recorded time (any category) per HLTB.
|
||||
5. Your play style — extrapolated from completed-game calibration vs HLTB.
|
||||
"""
|
||||
games = require_snapshot_games()
|
||||
if games is None:
|
||||
snapshot = load_snapshot()
|
||||
if snapshot is None:
|
||||
_echo("No snapshot found. Run 'scan' first.")
|
||||
return
|
||||
|
||||
games = [GameInfo.from_snapshot(d) for d in snapshot]
|
||||
games = _refresh_recently_played_completions(games, _config)
|
||||
# Count all 100%-achievement games in library (more accurate than
|
||||
# finished_app_ids, which only tracks enforcer-assigned completions).
|
||||
|
||||
@ -21,7 +21,6 @@ from steam_backlog_enforcer._desktop_env import (
|
||||
)
|
||||
from steam_backlog_enforcer._steam_launch import steam_is_installed
|
||||
from steam_backlog_enforcer._steam_process import spawn_detached
|
||||
from steam_backlog_enforcer._steam_restart_guard import fast_install_running
|
||||
from steam_backlog_enforcer._steam_state import STEAMAPPS_PATH
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -66,9 +65,6 @@ def _ensure_steam_running() -> None:
|
||||
if not steam_is_installed():
|
||||
logger.info("Steam is not installed — skipping client start.")
|
||||
return
|
||||
if fast_install_running():
|
||||
logger.info("steam-game-installer is running — leaving Steam closed.")
|
||||
return
|
||||
|
||||
# Check if any steam process is running (main client, not just helpers).
|
||||
try:
|
||||
|
||||
@ -50,13 +50,3 @@ class GameInProgressError(SteamUnavailableError):
|
||||
unrelated change killed a live session. Library hiding can wait; a player's
|
||||
afternoon cannot be given back.
|
||||
"""
|
||||
|
||||
|
||||
class FastInstallInProgressError(SteamUnavailableError):
|
||||
"""Raised to keep Steam closed while steam-game-installer is running.
|
||||
|
||||
The installer shuts Steam down because a live client owns
|
||||
``appmanifest_<appid>.acf`` and rewrites it from memory. A Steam started
|
||||
underneath it discards the manifest the installer is about to write and
|
||||
resumes the slow client download - so every launch path defers instead.
|
||||
"""
|
||||
|
||||
@ -31,9 +31,7 @@ from steam_backlog_enforcer._steam_errors import (
|
||||
)
|
||||
from steam_backlog_enforcer._steam_process import _run_as_user
|
||||
from steam_backlog_enforcer._steam_restart_guard import (
|
||||
assert_no_fast_install,
|
||||
assert_safe_to_restart,
|
||||
fast_install_running,
|
||||
game_is_running,
|
||||
)
|
||||
from steam_backlog_enforcer._steam_state import steam_update_in_progress
|
||||
@ -57,6 +55,10 @@ def steam_is_installed() -> bool:
|
||||
return Path(_STEAM_BINARY).exists()
|
||||
|
||||
|
||||
# Handles for fire-and-forget launches, kept only so they can be reaped.
|
||||
_SPAWNED: list[subprocess.Popen[bytes]] = []
|
||||
|
||||
|
||||
# ──────────────────────────────────────────────────────────────
|
||||
# Ensure Steam is running with devtools port
|
||||
# ──────────────────────────────────────────────────────────────
|
||||
@ -168,7 +170,6 @@ def ensure_steam_debug_port() -> None:
|
||||
SteamUnavailableError: If Steam is not installed, or is installed but
|
||||
never opens its debug port.
|
||||
"""
|
||||
assert_no_fast_install()
|
||||
if _steam_has_debug_port():
|
||||
logger.debug("Steam CDP port already available.")
|
||||
return
|
||||
@ -230,10 +231,10 @@ def restart_steam() -> None:
|
||||
)
|
||||
return
|
||||
|
||||
if steam_update_in_progress() or fast_install_running():
|
||||
if steam_update_in_progress():
|
||||
logger.warning(
|
||||
"Skipping Steam restart — a game update or fast install is in "
|
||||
"progress; restarting now could corrupt it.",
|
||||
"Skipping Steam restart — a game update is in progress; "
|
||||
"restarting now could corrupt it.",
|
||||
)
|
||||
return
|
||||
|
||||
|
||||
@ -12,10 +12,8 @@ Split out of :mod:`_steam_launch` to keep it under the 250-line cap, and because
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
from steam_backlog_enforcer._steam_errors import (
|
||||
FastInstallInProgressError,
|
||||
GameInProgressError,
|
||||
SteamUpdateInProgressError,
|
||||
)
|
||||
@ -66,40 +64,3 @@ def assert_safe_to_restart() -> None:
|
||||
)
|
||||
logger.info(msg)
|
||||
raise SteamUpdateInProgressError(msg)
|
||||
|
||||
|
||||
# Matched against /proc cmdlines, so a run started by hand counts exactly like
|
||||
# one the enforcer spawned. run.sh as well as the module it execs: the sudo
|
||||
# and bash wrappers exist the moment Popen returns, the Python process only a
|
||||
# moment later, and a Steam launch in that gap would race the shutdown.
|
||||
_INSTALLER_MARKERS = (b"steam-game-installer/run.sh", b"steam_installer.cli")
|
||||
|
||||
|
||||
def fast_install_running() -> bool:
|
||||
"""Whether a steam-game-installer run is live (and so owns Steam's state).
|
||||
|
||||
Returns:
|
||||
True if any process is running the installer's CLI module.
|
||||
"""
|
||||
for entry in Path("/proc").iterdir():
|
||||
if not entry.name.isdigit():
|
||||
continue
|
||||
try:
|
||||
cmdline = (entry / "cmdline").read_bytes()
|
||||
except OSError:
|
||||
continue
|
||||
if any(marker in cmdline for marker in _INSTALLER_MARKERS):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def assert_no_fast_install() -> None:
|
||||
"""Refuse to launch Steam while steam-game-installer holds it closed.
|
||||
|
||||
Raises:
|
||||
FastInstallInProgressError: If an installer run is live.
|
||||
"""
|
||||
if fast_install_running():
|
||||
msg = "Deferring Steam launch: steam-game-installer is running."
|
||||
logger.info(msg)
|
||||
raise FastInstallInProgressError(msg)
|
||||
|
||||
@ -79,7 +79,7 @@ def _manifest_transfer_active(manifest: Path) -> bool:
|
||||
) > _field("BytesStaged")
|
||||
|
||||
|
||||
def steam_update_in_progress(exclude_app_id: int | None = None) -> bool:
|
||||
def steam_update_in_progress() -> bool:
|
||||
"""Return True if any installed Steam app is mid-update.
|
||||
|
||||
Steam records live transfer progress in each ``appmanifest_*.acf``: a game
|
||||
@ -90,40 +90,11 @@ def steam_update_in_progress(exclude_app_id: int | None = None) -> bool:
|
||||
failure that corrupted Age of Empires II DE into a deterministic launch
|
||||
crash).
|
||||
|
||||
Args:
|
||||
exclude_app_id: An app whose own transfer does not count - the one a
|
||||
fast install is about to take over.
|
||||
|
||||
Returns:
|
||||
True if at least one appmanifest shows an unfinished download/stage.
|
||||
"""
|
||||
skip = f"appmanifest_{exclude_app_id}.acf"
|
||||
try:
|
||||
manifests = list(STEAMAPPS_PATH.glob("appmanifest_*.acf"))
|
||||
except OSError:
|
||||
return False
|
||||
return any(_manifest_transfer_active(m) for m in manifests if m.name != skip)
|
||||
|
||||
|
||||
def is_game_fully_installed(app_id: int) -> bool:
|
||||
"""Whether *app_id* is completely installed, not merely queued.
|
||||
|
||||
:func:`_steam_client.is_game_installed` counts any manifest, which is right
|
||||
for "has an install been triggered". This is the stricter question a fast
|
||||
install needs: a manifest Steam wrote for its own slow download (no
|
||||
FullyInstalled bit, or bytes still in flight) is work to take over.
|
||||
|
||||
Args:
|
||||
app_id: Steam application ID.
|
||||
|
||||
Returns:
|
||||
True if the manifest has StateFlags bit 4 and no transfer in flight.
|
||||
"""
|
||||
manifest = STEAMAPPS_PATH / f"appmanifest_{app_id}.acf"
|
||||
try:
|
||||
content = manifest.read_text(encoding="utf-8", errors="replace")
|
||||
except OSError:
|
||||
return False
|
||||
match = re.search(r'"StateFlags"\s+"(\d+)"', content)
|
||||
flags = int(match.group(1)) if match else 0
|
||||
return bool(flags & 4) and not _manifest_transfer_active(manifest)
|
||||
return any(_manifest_transfer_active(m) for m in manifests)
|
||||
|
||||
@ -16,8 +16,6 @@ from steam_backlog_enforcer._store_tools import (
|
||||
IPTABLES,
|
||||
IPTABLES_CHAIN,
|
||||
SUDO,
|
||||
ensure_chain_in_output,
|
||||
run_quiet,
|
||||
)
|
||||
from steam_backlog_enforcer.config import (
|
||||
BLOCKED_DOMAINS,
|
||||
@ -84,7 +82,20 @@ def _block_store_iptables() -> bool:
|
||||
check=True,
|
||||
)
|
||||
|
||||
ensure_chain_in_output(IPTABLES_CHAIN)
|
||||
# Hook our chain into OUTPUT if not already there.
|
||||
result = subprocess.run(
|
||||
[SUDO, IPTABLES, "-C", "OUTPUT", "-j", IPTABLES_CHAIN],
|
||||
capture_output=True,
|
||||
timeout=5,
|
||||
check=False,
|
||||
)
|
||||
if result.returncode != 0:
|
||||
subprocess.run(
|
||||
[SUDO, IPTABLES, "-I", "OUTPUT", "-j", IPTABLES_CHAIN],
|
||||
capture_output=True,
|
||||
timeout=5,
|
||||
check=True,
|
||||
)
|
||||
except OSError, subprocess.SubprocessError:
|
||||
logger.exception("Failed to block store via iptables")
|
||||
return False
|
||||
@ -129,4 +140,9 @@ def flush_dns_cache() -> None:
|
||||
]
|
||||
for cmd in commands:
|
||||
with contextlib.suppress(FileNotFoundError, OSError):
|
||||
run_quiet(cmd)
|
||||
subprocess.run(
|
||||
cmd,
|
||||
capture_output=True,
|
||||
timeout=5,
|
||||
check=False,
|
||||
)
|
||||
|
||||
@ -9,7 +9,6 @@ from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
# Path to the hosts install script. _REPO_ROOT resolves to $HOME (this
|
||||
# module lives two levels below it); the script itself is in the
|
||||
@ -37,27 +36,3 @@ TEE = shutil.which("tee") or "/usr/bin/tee"
|
||||
|
||||
# IP address used in /etc/hosts for blocking domains.
|
||||
HOSTS_REDIRECT_IP = ".".join(["0"] * 4)
|
||||
|
||||
|
||||
def run_quiet(
|
||||
cmd: list[str], *, timeout: float = 5
|
||||
) -> subprocess.CompletedProcess[bytes]:
|
||||
"""Run ``cmd`` with output captured and no exception on a non-zero exit."""
|
||||
return subprocess.run(cmd, capture_output=True, timeout=timeout, check=False)
|
||||
|
||||
|
||||
def ensure_chain_in_output(chain: str) -> None:
|
||||
"""Hook ``chain`` into iptables' OUTPUT if it is not already there.
|
||||
|
||||
Raises:
|
||||
subprocess.CalledProcessError: If the insert itself fails -- a chain
|
||||
that exists but is not reachable from OUTPUT blocks nothing.
|
||||
"""
|
||||
probe = run_quiet([SUDO, IPTABLES, "-C", "OUTPUT", "-j", chain])
|
||||
if probe.returncode != 0:
|
||||
subprocess.run(
|
||||
[SUDO, IPTABLES, "-I", "OUTPUT", "-j", chain],
|
||||
capture_output=True,
|
||||
timeout=5,
|
||||
check=True,
|
||||
)
|
||||
|
||||
@ -12,10 +12,10 @@ from __future__ import annotations
|
||||
import contextlib
|
||||
import json
|
||||
import logging
|
||||
import shutil
|
||||
import socket
|
||||
import subprocess
|
||||
|
||||
from steam_backlog_enforcer._store_tools import IPTABLES, SUDO, ensure_chain_in_output
|
||||
from steam_backlog_enforcer._total_block_domains import (
|
||||
_ALL_TOTAL_BLOCK_DOMAINS,
|
||||
NULL_ROUTE_IP,
|
||||
@ -24,6 +24,9 @@ from steam_backlog_enforcer.config import CONFIG_DIR, _atomic_write
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
_IPTABLES = shutil.which("iptables") or "/usr/sbin/iptables"
|
||||
_SUDO = shutil.which("sudo") or "/usr/bin/sudo"
|
||||
|
||||
IPTABLES_CHAIN = "STEAM_TOTAL_BLOCK"
|
||||
|
||||
_IPTABLES_IP_CACHE_FILE = CONFIG_DIR / "total_block_ip_cache.json"
|
||||
@ -56,7 +59,7 @@ def _iptables_chain_intact(expected_ips: set[str]) -> bool:
|
||||
3-second enforce tick.
|
||||
"""
|
||||
listing = subprocess.run(
|
||||
[SUDO, IPTABLES, "-S", IPTABLES_CHAIN],
|
||||
[_SUDO, _IPTABLES, "-S", IPTABLES_CHAIN],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=5,
|
||||
@ -77,7 +80,7 @@ def _iptables_chain_intact(expected_ips: set[str]) -> bool:
|
||||
return False
|
||||
|
||||
hook = subprocess.run(
|
||||
[SUDO, IPTABLES, "-C", "OUTPUT", "-j", IPTABLES_CHAIN],
|
||||
[_SUDO, _IPTABLES, "-C", "OUTPUT", "-j", IPTABLES_CHAIN],
|
||||
capture_output=True,
|
||||
timeout=5,
|
||||
check=False,
|
||||
@ -112,13 +115,13 @@ def apply_total_block_iptables() -> bool:
|
||||
resolved_ips: set[str] = set()
|
||||
try:
|
||||
subprocess.run(
|
||||
[SUDO, IPTABLES, "-N", IPTABLES_CHAIN],
|
||||
[_SUDO, _IPTABLES, "-N", IPTABLES_CHAIN],
|
||||
capture_output=True,
|
||||
timeout=5,
|
||||
check=False,
|
||||
)
|
||||
subprocess.run(
|
||||
[SUDO, IPTABLES, "-F", IPTABLES_CHAIN],
|
||||
[_SUDO, _IPTABLES, "-F", IPTABLES_CHAIN],
|
||||
capture_output=True,
|
||||
timeout=5,
|
||||
check=True,
|
||||
@ -134,13 +137,25 @@ def apply_total_block_iptables() -> bool:
|
||||
|
||||
for ip in blocked_ips:
|
||||
subprocess.run(
|
||||
[SUDO, IPTABLES, "-A", IPTABLES_CHAIN, "-d", ip, "-j", "DROP"],
|
||||
[_SUDO, _IPTABLES, "-A", IPTABLES_CHAIN, "-d", ip, "-j", "DROP"],
|
||||
capture_output=True,
|
||||
timeout=5,
|
||||
check=True,
|
||||
)
|
||||
|
||||
ensure_chain_in_output(IPTABLES_CHAIN)
|
||||
result = subprocess.run(
|
||||
[_SUDO, _IPTABLES, "-C", "OUTPUT", "-j", IPTABLES_CHAIN],
|
||||
capture_output=True,
|
||||
timeout=5,
|
||||
check=False,
|
||||
)
|
||||
if result.returncode != 0:
|
||||
subprocess.run(
|
||||
[_SUDO, _IPTABLES, "-I", "OUTPUT", "-j", IPTABLES_CHAIN],
|
||||
capture_output=True,
|
||||
timeout=5,
|
||||
check=True,
|
||||
)
|
||||
except OSError, subprocess.SubprocessError:
|
||||
logger.exception("Failed to apply total-block iptables rules")
|
||||
return False
|
||||
@ -152,19 +167,19 @@ def remove_total_block_iptables() -> bool:
|
||||
"""Remove the total-block iptables chain and its OUTPUT hook."""
|
||||
try:
|
||||
subprocess.run(
|
||||
[SUDO, IPTABLES, "-D", "OUTPUT", "-j", IPTABLES_CHAIN],
|
||||
[_SUDO, _IPTABLES, "-D", "OUTPUT", "-j", IPTABLES_CHAIN],
|
||||
capture_output=True,
|
||||
timeout=5,
|
||||
check=False,
|
||||
)
|
||||
subprocess.run(
|
||||
[SUDO, IPTABLES, "-F", IPTABLES_CHAIN],
|
||||
[_SUDO, _IPTABLES, "-F", IPTABLES_CHAIN],
|
||||
capture_output=True,
|
||||
timeout=5,
|
||||
check=False,
|
||||
)
|
||||
subprocess.run(
|
||||
[SUDO, IPTABLES, "-X", IPTABLES_CHAIN],
|
||||
[_SUDO, _IPTABLES, "-X", IPTABLES_CHAIN],
|
||||
capture_output=True,
|
||||
timeout=5,
|
||||
check=False,
|
||||
|
||||
@ -13,7 +13,6 @@ from steam_backlog_enforcer._desktop_env import (
|
||||
desktop_user_cmd,
|
||||
resolve_desktop_user,
|
||||
)
|
||||
from steam_backlog_enforcer._store_tools import run_quiet
|
||||
from steam_backlog_enforcer.game_uninstall import is_protected_app
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -164,7 +163,12 @@ def send_notification(title: str, body: str) -> None:
|
||||
resolve_desktop_user(),
|
||||
)
|
||||
try:
|
||||
run_quiet(cmd)
|
||||
subprocess.run(
|
||||
cmd,
|
||||
capture_output=True,
|
||||
timeout=5,
|
||||
check=False,
|
||||
)
|
||||
except FileNotFoundError, OSError:
|
||||
logger.debug("notify-send not available.")
|
||||
except subprocess.TimeoutExpired:
|
||||
|
||||
@ -13,21 +13,14 @@ from steam_backlog_enforcer._desktop_env import (
|
||||
desktop_user_cmd,
|
||||
)
|
||||
from steam_backlog_enforcer._echo import _echo
|
||||
from steam_backlog_enforcer._fast_install import (
|
||||
fast_install,
|
||||
is_fast_installing,
|
||||
poll_fast_installs,
|
||||
)
|
||||
from steam_backlog_enforcer._steam_client import (
|
||||
_ensure_steam_running,
|
||||
_get_real_user,
|
||||
_get_uid_gid_for_user,
|
||||
is_game_installed,
|
||||
)
|
||||
from steam_backlog_enforcer._steam_restart_guard import fast_install_running
|
||||
from steam_backlog_enforcer._steam_state import (
|
||||
STEAMAPPS_PATH,
|
||||
is_game_fully_installed,
|
||||
steam_library_ready,
|
||||
)
|
||||
from steam_backlog_enforcer.game_uninstall import (
|
||||
@ -56,6 +49,22 @@ __all__ = [
|
||||
# rather than once per game per pass.
|
||||
_LIBRARY_WARNED: set[str] = set()
|
||||
|
||||
_UNINSTALL_EXPORTS = frozenset(
|
||||
{
|
||||
"get_installed_games",
|
||||
"is_protected_app",
|
||||
"uninstall_game",
|
||||
"uninstall_other_games",
|
||||
}
|
||||
)
|
||||
|
||||
# Folder-name safety net for _remove_game_dirs. Independent of the app-id
|
||||
# gating callers already do (uninstall_other_games skips allowed app ids) --
|
||||
# this protects against deleting the *wrong* directory for an allowed game
|
||||
# when its name has been written inconsistently (e.g. "KingdomComeDeliverance2"
|
||||
# vs "Kingdom Come: Deliverance II" vs a typo'd variant), which is exactly the
|
||||
# kind of multi-name confusion that caused real data loss once already.
|
||||
|
||||
|
||||
def _trigger_steam_install(app_id: int, label: str) -> bool:
|
||||
"""Ask Steam to install a game via the ``steam://install`` URI.
|
||||
@ -89,48 +98,6 @@ def _trigger_steam_install(app_id: int, label: str) -> bool:
|
||||
# ──────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
def _install_precheck(app_id: int, label: str) -> bool | None:
|
||||
"""Settle an install without starting one, where that is possible.
|
||||
|
||||
Returns:
|
||||
True if the game is installed or already being fast-installed, False
|
||||
if no install may start right now, None to go ahead and install.
|
||||
"""
|
||||
# Re-arm the one-shot warning before any early return, so a library that
|
||||
# comes back (Steam finally signed in) is reported again if it vanishes.
|
||||
if steam_library_ready():
|
||||
_LIBRARY_WARNED.discard("missing")
|
||||
|
||||
poll_fast_installs()
|
||||
if is_game_fully_installed(app_id):
|
||||
logger.info("Game already installed: %s", label)
|
||||
return True
|
||||
|
||||
# A live installer holds Steam closed; steam:// would reopen it underneath
|
||||
# the manifest the installer is about to write. Wait for it to finish.
|
||||
if fast_install_running():
|
||||
if is_fast_installing(app_id):
|
||||
return True
|
||||
logger.info("Deferring install of %s: steam-game-installer busy.", label)
|
||||
return False
|
||||
|
||||
# No library means no install can succeed — neither the steam:// handler
|
||||
# nor the appmanifest write below. Without this the enforce loop retried
|
||||
# every allowed game every pass (measured: 1656 times in 30 minutes).
|
||||
if not steam_library_ready():
|
||||
if "missing" not in _LIBRARY_WARNED:
|
||||
logger.warning(
|
||||
"Steam library not initialised (%s missing) — skipping installs "
|
||||
"until Steam has been signed in to at least once.",
|
||||
STEAMAPPS_PATH,
|
||||
)
|
||||
_LIBRARY_WARNED.add("missing")
|
||||
else:
|
||||
logger.debug("Skipping install of %s: no Steam library.", label)
|
||||
return False
|
||||
return None
|
||||
|
||||
|
||||
def install_game(
|
||||
app_id: int,
|
||||
game_name: str,
|
||||
@ -138,10 +105,7 @@ def install_game(
|
||||
*,
|
||||
use_steam_protocol: bool = False,
|
||||
) -> bool:
|
||||
"""Install a game, through steam-game-installer when it can be used.
|
||||
|
||||
The fast path (:mod:`_fast_install`) is always tried first; everything
|
||||
below it is the fallback for when it is refused or fails.
|
||||
"""Install a game by triggering a Steam download.
|
||||
|
||||
When *use_steam_protocol* is True the ``steam://install`` URI handler
|
||||
is used, which lets Steam determine the correct install directory from
|
||||
@ -164,17 +128,31 @@ def install_game(
|
||||
Returns True if the install was triggered successfully.
|
||||
"""
|
||||
label = game_name or f"AppID={app_id}"
|
||||
ready = _install_precheck(app_id, label)
|
||||
if ready is not None:
|
||||
return ready
|
||||
|
||||
if fast_install(app_id, label):
|
||||
return True
|
||||
# Steam already has a download of its own going: let it carry on, rather
|
||||
# than overwrite its manifest with the fabricated one below.
|
||||
# Re-arm the one-shot warning before any early return, so a library that
|
||||
# comes back (Steam finally signed in) is reported again if it vanishes.
|
||||
if steam_library_ready():
|
||||
_LIBRARY_WARNED.discard("missing")
|
||||
|
||||
if is_game_installed(app_id):
|
||||
logger.info("Game already installed: %s", label)
|
||||
return True
|
||||
|
||||
# No library means no install can succeed — neither the steam:// handler
|
||||
# nor the appmanifest write below. Without this the enforce loop retried
|
||||
# every allowed game every pass (measured: 1656 times in 30 minutes).
|
||||
if not steam_library_ready():
|
||||
if "missing" not in _LIBRARY_WARNED:
|
||||
logger.warning(
|
||||
"Steam library not initialised (%s missing) — skipping installs "
|
||||
"until Steam has been signed in to at least once.",
|
||||
STEAMAPPS_PATH,
|
||||
)
|
||||
_LIBRARY_WARNED.add("missing")
|
||||
else:
|
||||
logger.debug("Skipping install of %s: no Steam library.", label)
|
||||
return False
|
||||
|
||||
if use_steam_protocol:
|
||||
_ensure_steam_running()
|
||||
if _trigger_steam_install(app_id, label):
|
||||
|
||||
@ -95,10 +95,6 @@ def _remove_game_dirs(install_dir: Path | None, app_id: int) -> bool:
|
||||
success = True
|
||||
if install_dir and install_dir.is_dir():
|
||||
_assert_not_real_steam(install_dir)
|
||||
# Folder-name safety net, independent of the app-id gating callers
|
||||
# already do: it stops deleting the *wrong* directory for an allowed
|
||||
# game whose name was written inconsistently ("KingdomComeDeliverance2"
|
||||
# vs "Kingdom Come: Deliverance II"), which caused real data loss once.
|
||||
if _is_protected_name(install_dir.name):
|
||||
logger.warning(
|
||||
"Refusing to remove %s: name matches an allowed game", install_dir
|
||||
|
||||
@ -18,12 +18,8 @@ from __future__ import annotations
|
||||
|
||||
import json
|
||||
import logging
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from steam_backlog_enforcer._actions import allowed_app_ids
|
||||
from steam_backlog_enforcer._cdp import _cdp_result_value, _evaluate_js
|
||||
from steam_backlog_enforcer._echo import _echo
|
||||
from steam_backlog_enforcer._owned_apps_cache import get_all_owned_app_ids
|
||||
from steam_backlog_enforcer._steam_errors import (
|
||||
SteamUnavailableError,
|
||||
)
|
||||
@ -33,9 +29,6 @@ from steam_backlog_enforcer._steam_launch import (
|
||||
steam_is_installed,
|
||||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from steam_backlog_enforcer.config import Config, State
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Re-exported: the Steam lifecycle now lives in _steam_launch, but callers
|
||||
@ -202,19 +195,3 @@ def unhide_all_games(owned_app_ids: list[int]) -> int:
|
||||
count: int = parsed["count"]
|
||||
logger.info("Unhidden %d games via CDP.", count)
|
||||
return count
|
||||
|
||||
|
||||
def hide_others_and_report(config: Config, state: State, *, lead: str = "\n ") -> None:
|
||||
"""Hide every owned game the state does not allow, and say what happened.
|
||||
|
||||
``lead`` is the indentation (and blank line, by default) the report lines
|
||||
start with, so the caller's output stays aligned with its own.
|
||||
"""
|
||||
owned_ids = get_all_owned_app_ids(config)
|
||||
if not owned_ids:
|
||||
return
|
||||
hidden, skipped = try_hide_other_games(owned_ids, allowed_app_ids(state))
|
||||
if skipped is not None:
|
||||
_echo(f"{lead}Library hiding: skipped ({skipped})")
|
||||
elif hidden > 0:
|
||||
_echo(f"{lead}Library: hid {hidden} games")
|
||||
|
||||
@ -6,11 +6,11 @@ from typing import TYPE_CHECKING
|
||||
|
||||
from steam_backlog_enforcer._actions import allowed_app_ids, allowed_games
|
||||
from steam_backlog_enforcer._enforce_loop import get_all_owned_app_ids
|
||||
from steam_backlog_enforcer._steam_state import is_game_fully_installed
|
||||
from steam_backlog_enforcer.game_install import (
|
||||
_echo,
|
||||
get_installed_games,
|
||||
install_game,
|
||||
is_game_installed,
|
||||
is_protected_app,
|
||||
uninstall_other_games,
|
||||
)
|
||||
@ -75,7 +75,7 @@ def cmd_install(config: Config, state: State) -> None:
|
||||
_echo("No game currently assigned. Run 'scan' first.")
|
||||
return
|
||||
|
||||
if is_game_fully_installed(state.current_app_id):
|
||||
if is_game_installed(state.current_app_id):
|
||||
_echo(f"{state.current_game_name} is already installed.")
|
||||
return
|
||||
|
||||
|
||||
@ -9,25 +9,26 @@ from steam_backlog_enforcer._actions import (
|
||||
active_manual_picks,
|
||||
allowed_app_ids,
|
||||
allowed_games,
|
||||
apply_configured_pick,
|
||||
apply_manual_pick,
|
||||
manual_pick_slots_left,
|
||||
)
|
||||
from steam_backlog_enforcer._allowed_games import (
|
||||
MANUAL_LOCK_DAYS as _MANUAL_LOCK_DAYS,
|
||||
)
|
||||
from steam_backlog_enforcer._enforce_loop import get_all_owned_app_ids
|
||||
from steam_backlog_enforcer._hltb_types import load_hltb_cache
|
||||
from steam_backlog_enforcer._pick_completion import (
|
||||
report_completion,
|
||||
warn_stale_assignment,
|
||||
)
|
||||
from steam_backlog_enforcer._snapshot import load_snapshot, snapshot_game_name
|
||||
from steam_backlog_enforcer._steam_state import is_game_fully_installed
|
||||
from steam_backlog_enforcer._snapshot import load_snapshot
|
||||
from steam_backlog_enforcer.game_install import (
|
||||
_echo,
|
||||
install_game,
|
||||
is_game_installed,
|
||||
uninstall_other_games,
|
||||
)
|
||||
from steam_backlog_enforcer.library_hider import hide_others_and_report
|
||||
from steam_backlog_enforcer.library_hider import try_hide_other_games
|
||||
from steam_backlog_enforcer.main._shared import _MANUAL_LOCK_EXEMPT_COMMANDS
|
||||
from steam_backlog_enforcer.scanning import pick_next_game
|
||||
from steam_backlog_enforcer.steam_api import (
|
||||
@ -56,7 +57,13 @@ def cmd_pick(config: Config, state: State) -> None:
|
||||
pick_next_game(games, state, config)
|
||||
|
||||
if state.current_app_id is not None:
|
||||
hide_others_and_report(config, state)
|
||||
owned_ids = get_all_owned_app_ids(config)
|
||||
if owned_ids:
|
||||
hidden, skipped = try_hide_other_games(owned_ids, allowed_app_ids(state))
|
||||
if skipped is not None:
|
||||
_echo(f"\n Library hiding: skipped ({skipped})")
|
||||
elif hidden > 0:
|
||||
_echo(f"\n Library: hid {hidden} games")
|
||||
|
||||
|
||||
def _resolve_game_name(config: Config, app_id: int) -> str | None:
|
||||
@ -65,9 +72,11 @@ def _resolve_game_name(config: Config, app_id: int) -> str | None:
|
||||
Returns the game name, or None if not found.
|
||||
"""
|
||||
# Fast path: snapshot already on disk.
|
||||
name = snapshot_game_name(app_id)
|
||||
if name is not None:
|
||||
return name
|
||||
snapshot = load_snapshot()
|
||||
if snapshot:
|
||||
for entry in snapshot:
|
||||
if entry.get("app_id") == app_id:
|
||||
return str(entry["name"])
|
||||
|
||||
# Slower path: owned games API.
|
||||
try:
|
||||
@ -130,13 +139,19 @@ def _apply_allowed_set(config: Config, state: State) -> None:
|
||||
_echo(f" Uninstalled {count} non-allowed game(s)")
|
||||
|
||||
for app_id, name in allowed_games(state):
|
||||
if is_game_fully_installed(app_id):
|
||||
if is_game_installed(app_id):
|
||||
_echo(f" {name} is already installed.")
|
||||
continue
|
||||
_echo(f" Installing {name}...")
|
||||
install_game(app_id, name, config.steam_id, use_steam_protocol=True)
|
||||
|
||||
hide_others_and_report(config, state, lead=" ")
|
||||
owned_ids = get_all_owned_app_ids(config)
|
||||
if owned_ids:
|
||||
hidden, skipped = try_hide_other_games(owned_ids, allowed)
|
||||
if skipped is not None:
|
||||
_echo(f" Library hiding: skipped ({skipped})")
|
||||
elif hidden > 0:
|
||||
_echo(f" Library: hid {hidden} games")
|
||||
|
||||
|
||||
def cmd_pick_manual(config: Config, state: State, args: list[str]) -> None:
|
||||
@ -196,7 +211,12 @@ def cmd_pick_manual(config: Config, state: State, args: list[str]) -> None:
|
||||
|
||||
# State mutation is the shared, stdout-free core (also used by the MCP
|
||||
# server); the destructive post-assignment cascade below stays CLI-only.
|
||||
refused = apply_configured_pick(config, state, app_id, game_name)
|
||||
refused = apply_manual_pick(
|
||||
state,
|
||||
app_id,
|
||||
game_name,
|
||||
max_picks=config.max_manual_picks,
|
||||
)
|
||||
if refused is not None:
|
||||
_echo(f"\nError: {refused}")
|
||||
sys.exit(1)
|
||||
|
||||
@ -7,7 +7,7 @@ from typing import TYPE_CHECKING
|
||||
from steam_backlog_enforcer._actions import active_manual_picks
|
||||
from steam_backlog_enforcer._manual_pick_lifecycle import manual_pick_age_days
|
||||
from steam_backlog_enforcer._pick_completion import report_completion
|
||||
from steam_backlog_enforcer._snapshot import require_snapshot_games
|
||||
from steam_backlog_enforcer._snapshot import load_snapshot
|
||||
from steam_backlog_enforcer._total_block import get_total_block_status
|
||||
from steam_backlog_enforcer.game_install import (
|
||||
_echo,
|
||||
@ -15,11 +15,11 @@ from steam_backlog_enforcer.game_install import (
|
||||
is_protected_app,
|
||||
)
|
||||
from steam_backlog_enforcer.main._shared import _LIST_DISPLAY_LIMIT
|
||||
from steam_backlog_enforcer.steam_api import GameInfo
|
||||
from steam_backlog_enforcer.store_blocker import is_store_blocked
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from steam_backlog_enforcer.config import Config, State
|
||||
from steam_backlog_enforcer.steam_api import GameInfo
|
||||
|
||||
|
||||
def cmd_status(config: Config, state: State) -> None:
|
||||
@ -74,10 +74,12 @@ def cmd_status(config: Config, state: State) -> None:
|
||||
|
||||
def cmd_list(_config: Config, state: State) -> None:
|
||||
"""List games from the last snapshot."""
|
||||
games = require_snapshot_games()
|
||||
if games is None:
|
||||
snapshot = load_snapshot()
|
||||
if snapshot is None:
|
||||
_echo("No snapshot found. Run 'scan' first.")
|
||||
return
|
||||
|
||||
games = [GameInfo.from_snapshot(d) for d in snapshot]
|
||||
incomplete = [g for g in games if not g.is_complete]
|
||||
complete = [g for g in games if g.is_complete]
|
||||
|
||||
|
||||
@ -1,56 +0,0 @@
|
||||
"""Autouse guard that keeps tests away from steam-game-installer and /proc.
|
||||
|
||||
Split out of ``conftest.py`` to keep it inside the 250-line cap; ``conftest``
|
||||
imports the fixture by name, which is what registers it.
|
||||
|
||||
The real installer shuts the user's Steam down, so no test may find it: the
|
||||
installer path is pointed at a file that does not exist. The "is an installer
|
||||
running" scan reads the real /proc, so it answers False unless a test says
|
||||
otherwise - and it is imported by name into several modules, so every binding
|
||||
is patched. Tests that exercise the real scan import the function directly,
|
||||
which captures it before this fixture runs.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from steam_backlog_enforcer import _fast_install
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import Iterator
|
||||
from pathlib import Path
|
||||
|
||||
_RUNNING_BINDINGS = (
|
||||
"steam_backlog_enforcer._steam_restart_guard.fast_install_running",
|
||||
"steam_backlog_enforcer.game_install.fast_install_running",
|
||||
"steam_backlog_enforcer._steam_client.fast_install_running",
|
||||
"steam_backlog_enforcer._steam_launch.fast_install_running",
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _no_fast_install(tmp_path: Path) -> Iterator[None]:
|
||||
"""Hide the real installer, fake the /proc scan, reset run bookkeeping."""
|
||||
fake_steamapps = tmp_path / "steamapps"
|
||||
fake_steamapps.mkdir(exist_ok=True)
|
||||
_fast_install._RUNS.clear()
|
||||
_fast_install._FAILED.clear()
|
||||
patches = [patch(name, return_value=False) for name in _RUNNING_BINDINGS]
|
||||
patches += [
|
||||
# Absolute, so `home / _INSTALLER` resolves here and never under ~.
|
||||
patch.object(_fast_install, "_INSTALLER", tmp_path / "no-installer" / "run.sh"),
|
||||
patch.object(_fast_install, "STEAMAPPS_PATH", fake_steamapps),
|
||||
]
|
||||
for p in patches:
|
||||
p.start()
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
for p in reversed(patches):
|
||||
p.stop()
|
||||
_fast_install._RUNS.clear()
|
||||
_fast_install._FAILED.clear()
|
||||
@ -91,15 +91,6 @@ def _block_real_subprocesses() -> Iterator[None]:
|
||||
"steam_backlog_enforcer._playtime_run.subprocess.run",
|
||||
noop_run,
|
||||
),
|
||||
# steam-game-installer closes the user's Steam; never reach it.
|
||||
patch(
|
||||
"steam_backlog_enforcer._fast_install.subprocess.run",
|
||||
noop_run,
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer._fast_install.subprocess.Popen",
|
||||
noop_popen,
|
||||
),
|
||||
# A real `npm run build` here would rewrite web/dist/index.html, which
|
||||
# then perturbs frontend_is_stale() for every later test in the run.
|
||||
patch(
|
||||
|
||||
@ -23,7 +23,6 @@ import pytest
|
||||
# Imported for its autouse side effect: naming it here registers it.
|
||||
from steam_backlog_enforcer.tests._isolate_incidents import _isolate_incidents
|
||||
from steam_backlog_enforcer.tests._isolate_playtime import _isolate_playtime
|
||||
from steam_backlog_enforcer.tests._no_fast_install import _no_fast_install
|
||||
from steam_backlog_enforcer.tests._no_subprocess import _block_real_subprocesses
|
||||
from steam_backlog_enforcer.tests._no_workout_http import _no_workout_http
|
||||
|
||||
@ -33,7 +32,6 @@ __all__ = [
|
||||
"_block_real_subprocesses",
|
||||
"_isolate_incidents",
|
||||
"_isolate_playtime",
|
||||
"_no_fast_install",
|
||||
"_no_workout_http",
|
||||
]
|
||||
|
||||
@ -83,8 +81,8 @@ def _isolate_filesystem(tmp_path: Path) -> Iterator[None]:
|
||||
fake_config / "snapshot.json",
|
||||
),
|
||||
# Steam game manifests / install dirs. STEAMAPPS_PATH is canonical in
|
||||
# _steam_state; game_install and _steam_client import it by name, so
|
||||
# every binding needs the patch (same gotcha as HOSTS_FILE below).
|
||||
# _steam_state; game_install imports it, so both bindings need the
|
||||
# patch (same gotcha as HOSTS_FILE below).
|
||||
patch(
|
||||
"steam_backlog_enforcer._steam_state.STEAMAPPS_PATH",
|
||||
fake_steamapps,
|
||||
@ -93,10 +91,6 @@ def _isolate_filesystem(tmp_path: Path) -> Iterator[None]:
|
||||
"steam_backlog_enforcer.game_install.STEAMAPPS_PATH",
|
||||
fake_steamapps,
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer._steam_client.STEAMAPPS_PATH",
|
||||
fake_steamapps,
|
||||
),
|
||||
# HLTB cache file (computed at import time from CONFIG_DIR, so
|
||||
# patching CONFIG_DIR alone does not redirect it)
|
||||
patch(
|
||||
|
||||
@ -124,7 +124,7 @@ class TestEnforceAutoInstall:
|
||||
def test_already_installed(self) -> None:
|
||||
state = State(current_app_id=1, current_game_name="G")
|
||||
with (
|
||||
patch(f"{ENFORCE_STEPS_PKG}.is_game_fully_installed", return_value=True),
|
||||
patch(f"{ENFORCE_STEPS_PKG}.is_game_installed", return_value=True),
|
||||
patch(f"{ENFORCE_STEPS_PKG}._echo"),
|
||||
):
|
||||
_enforce_auto_install(Config(), state)
|
||||
@ -132,7 +132,7 @@ class TestEnforceAutoInstall:
|
||||
def test_installs_successfully(self) -> None:
|
||||
state = State(current_app_id=1, current_game_name="G")
|
||||
with (
|
||||
patch(f"{ENFORCE_STEPS_PKG}.is_game_fully_installed", return_value=False),
|
||||
patch(f"{ENFORCE_STEPS_PKG}.is_game_installed", return_value=False),
|
||||
patch(f"{ENFORCE_STEPS_PKG}.install_game", return_value=True),
|
||||
patch(f"{ENFORCE_STEPS_PKG}.send_notification"),
|
||||
patch(f"{ENFORCE_STEPS_PKG}._echo"),
|
||||
@ -142,7 +142,7 @@ class TestEnforceAutoInstall:
|
||||
def test_install_fails(self) -> None:
|
||||
state = State(current_app_id=1, current_game_name="G")
|
||||
with (
|
||||
patch(f"{ENFORCE_STEPS_PKG}.is_game_fully_installed", return_value=False),
|
||||
patch(f"{ENFORCE_STEPS_PKG}.is_game_installed", return_value=False),
|
||||
patch(f"{ENFORCE_STEPS_PKG}.install_game", return_value=False),
|
||||
patch(f"{ENFORCE_STEPS_PKG}._echo") as mock_echo,
|
||||
):
|
||||
|
||||
@ -1,215 +0,0 @@
|
||||
"""Tests for the guards around a fast install.
|
||||
|
||||
Covers the /proc scan and launch guard in _steam_restart_guard, the
|
||||
fully-installed predicate and target-app exclusion in _steam_state, and every
|
||||
place that must keep Steam closed or defer while steam-game-installer runs.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from steam_backlog_enforcer import _steam_state
|
||||
from steam_backlog_enforcer._enforce_steps import _reinstall_missing_allowed
|
||||
from steam_backlog_enforcer._steam_client import _ensure_steam_running
|
||||
from steam_backlog_enforcer._steam_errors import (
|
||||
FastInstallInProgressError,
|
||||
SteamUnavailableError,
|
||||
)
|
||||
from steam_backlog_enforcer._steam_launch import ensure_steam_debug_port, restart_steam
|
||||
|
||||
# Bound at import, before the autouse guard replaces the module attribute, so
|
||||
# the real /proc scan is what gets tested here.
|
||||
from steam_backlog_enforcer._steam_restart_guard import (
|
||||
assert_no_fast_install,
|
||||
fast_install_running,
|
||||
)
|
||||
from steam_backlog_enforcer.config import Config, State
|
||||
from steam_backlog_enforcer.game_install import install_game
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pathlib import Path
|
||||
|
||||
GUARD = "steam_backlog_enforcer._steam_restart_guard"
|
||||
GI = "steam_backlog_enforcer.game_install"
|
||||
LAUNCH = "steam_backlog_enforcer._steam_launch"
|
||||
|
||||
|
||||
def _manifest(app_id: int, flags: int, *, to_download: int = 0) -> None:
|
||||
path = _steam_state.STEAMAPPS_PATH / f"appmanifest_{app_id}.acf"
|
||||
path.write_text(
|
||||
f'"AppState"\n{{\n\t"StateFlags"\t\t"{flags}"\n'
|
||||
f'\t"BytesToDownload"\t\t"{to_download}"\n\t"BytesDownloaded"\t\t"0"\n}}\n'
|
||||
)
|
||||
|
||||
|
||||
class TestFastInstallRunning:
|
||||
"""The scan matches the wrapper and the module, nothing else."""
|
||||
|
||||
def _proc(self, tmp_path: Path, cmdlines: dict[str, bytes | None]) -> Path:
|
||||
proc = tmp_path / "proc"
|
||||
for pid, cmdline in cmdlines.items():
|
||||
(proc / pid).mkdir(parents=True)
|
||||
if cmdline is not None:
|
||||
(proc / pid / "cmdline").write_bytes(cmdline)
|
||||
return proc
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"cmdline",
|
||||
[
|
||||
b"bash\0/home/u/src/steam-game-installer/run.sh\0--appid\0001",
|
||||
b"python\0-m\0steam_installer.cli\0--appid\0001",
|
||||
],
|
||||
)
|
||||
def test_detects_installer(self, tmp_path: Path, cmdline: bytes) -> None:
|
||||
proc = self._proc(tmp_path, {"self": b"", "10": None, "11": cmdline})
|
||||
with patch(f"{GUARD}.Path", return_value=proc):
|
||||
assert fast_install_running() is True
|
||||
|
||||
def test_nothing_running(self, tmp_path: Path) -> None:
|
||||
proc = self._proc(tmp_path, {"self": b"", "10": None, "11": b"steam\0-silent"})
|
||||
with patch(f"{GUARD}.Path", return_value=proc):
|
||||
assert fast_install_running() is False
|
||||
|
||||
def test_assert_raises_while_running(self) -> None:
|
||||
with (
|
||||
patch(f"{GUARD}.fast_install_running", return_value=True),
|
||||
pytest.raises(FastInstallInProgressError),
|
||||
):
|
||||
assert_no_fast_install()
|
||||
|
||||
def test_assert_passes_when_idle(self) -> None:
|
||||
assert_no_fast_install()
|
||||
|
||||
def test_error_degrades_like_other_steam_errors(self) -> None:
|
||||
assert issubclass(FastInstallInProgressError, SteamUnavailableError)
|
||||
|
||||
|
||||
class TestFullyInstalled:
|
||||
"""Only a finished, settled manifest counts as fully installed."""
|
||||
|
||||
def test_missing(self) -> None:
|
||||
assert _steam_state.is_game_fully_installed(1) is False
|
||||
|
||||
def test_installed(self) -> None:
|
||||
_manifest(1, 4)
|
||||
assert _steam_state.is_game_fully_installed(1) is True
|
||||
|
||||
def test_steam_still_downloading(self) -> None:
|
||||
_manifest(1, 1042, to_download=10)
|
||||
assert _steam_state.is_game_fully_installed(1) is False
|
||||
|
||||
def test_flag_set_but_bytes_in_flight(self) -> None:
|
||||
_manifest(1, 1044, to_download=10)
|
||||
assert _steam_state.is_game_fully_installed(1) is False
|
||||
|
||||
def test_no_state_flags(self) -> None:
|
||||
path = _steam_state.STEAMAPPS_PATH / "appmanifest_1.acf"
|
||||
path.write_text('"AppState"\n{\n}\n')
|
||||
assert _steam_state.is_game_fully_installed(1) is False
|
||||
|
||||
def test_update_check_can_exclude_the_target(self) -> None:
|
||||
_manifest(7, 1026, to_download=10)
|
||||
assert _steam_state.steam_update_in_progress() is True
|
||||
assert _steam_state.steam_update_in_progress(exclude_app_id=7) is False
|
||||
|
||||
|
||||
class TestInstallGameFastPath:
|
||||
"""install_game prefers the installer and never reopens Steam under it."""
|
||||
|
||||
def test_own_run_in_progress(self) -> None:
|
||||
with (
|
||||
patch(f"{GI}.fast_install_running", return_value=True),
|
||||
patch(f"{GI}.is_fast_installing", return_value=True),
|
||||
patch(f"{GI}.fast_install") as fast,
|
||||
):
|
||||
assert install_game(1, "G", "sid", use_steam_protocol=True) is True
|
||||
fast.assert_not_called()
|
||||
|
||||
def test_other_run_defers(self) -> None:
|
||||
with (
|
||||
patch(f"{GI}.fast_install_running", return_value=True),
|
||||
patch(f"{GI}.is_fast_installing", return_value=False),
|
||||
patch(f"{GI}._trigger_steam_install") as trigger,
|
||||
):
|
||||
assert install_game(1, "G", "sid", use_steam_protocol=True) is False
|
||||
trigger.assert_not_called()
|
||||
|
||||
def test_fast_install_wins(self) -> None:
|
||||
with (
|
||||
patch(f"{GI}.fast_install", return_value=True),
|
||||
patch(f"{GI}._trigger_steam_install") as trigger,
|
||||
):
|
||||
assert install_game(1, "G", "sid", use_steam_protocol=True) is True
|
||||
trigger.assert_not_called()
|
||||
|
||||
def test_steams_own_download_is_left_running(self) -> None:
|
||||
_manifest(1, 1026, to_download=10)
|
||||
before = (_steam_state.STEAMAPPS_PATH / "appmanifest_1.acf").read_text()
|
||||
with (
|
||||
patch(f"{GI}.fast_install", return_value=False),
|
||||
patch(f"{GI}._trigger_steam_install") as trigger,
|
||||
):
|
||||
assert install_game(1, "G", "sid", use_steam_protocol=True) is True
|
||||
trigger.assert_not_called()
|
||||
after = (_steam_state.STEAMAPPS_PATH / "appmanifest_1.acf").read_text()
|
||||
assert after == before
|
||||
|
||||
|
||||
class TestSteamStaysClosed:
|
||||
"""Every Steam start path defers to a live installer."""
|
||||
|
||||
def test_ensure_steam_running(self) -> None:
|
||||
with (
|
||||
patch(
|
||||
"steam_backlog_enforcer._steam_client.steam_is_installed",
|
||||
return_value=True,
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer._steam_client.fast_install_running",
|
||||
return_value=True,
|
||||
),
|
||||
patch("steam_backlog_enforcer._steam_client.spawn_detached") as spawn,
|
||||
):
|
||||
_ensure_steam_running()
|
||||
spawn.assert_not_called()
|
||||
|
||||
def test_debug_port(self) -> None:
|
||||
with (
|
||||
patch(f"{GUARD}.fast_install_running", return_value=True),
|
||||
patch(f"{LAUNCH}._launch_steam_with_debug") as launch,
|
||||
pytest.raises(FastInstallInProgressError),
|
||||
):
|
||||
ensure_steam_debug_port()
|
||||
launch.assert_not_called()
|
||||
|
||||
def test_restart(self) -> None:
|
||||
with (
|
||||
patch(f"{LAUNCH}.game_is_running", return_value=False),
|
||||
patch(f"{LAUNCH}.steam_update_in_progress", return_value=False),
|
||||
patch(f"{LAUNCH}.fast_install_running", return_value=True),
|
||||
patch(f"{LAUNCH}._shutdown_steam") as shutdown,
|
||||
):
|
||||
restart_steam()
|
||||
shutdown.assert_not_called()
|
||||
|
||||
|
||||
class TestReinstallPollsRuns:
|
||||
"""The loop reaps detached runs even when no game is missing."""
|
||||
|
||||
def test_polls_every_pass(self) -> None:
|
||||
with (
|
||||
patch(
|
||||
"steam_backlog_enforcer._enforce_steps.steam_library_ready",
|
||||
return_value=True,
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer._enforce_steps.allowed_games", return_value=[]
|
||||
),
|
||||
patch("steam_backlog_enforcer._enforce_steps.poll_fast_installs") as poll,
|
||||
):
|
||||
_reinstall_missing_allowed(Config(), MagicMock(spec=State))
|
||||
poll.assert_called_once()
|
||||
@ -1,136 +0,0 @@
|
||||
"""Tests for _fast_install's pure helpers: paths, account, refusal, argv.
|
||||
|
||||
The run lifecycle (spawn, poll, fast_install) lives in test_fast_install_runs.py
|
||||
to keep both files under the 250-line cap.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from steam_backlog_enforcer import _fast_install
|
||||
|
||||
PKG = "steam_backlog_enforcer._fast_install"
|
||||
|
||||
|
||||
class TestInstallerPath:
|
||||
"""run.sh is resolved from the desktop user's passwd home."""
|
||||
|
||||
def test_found_in_user_home(self, tmp_path: Path) -> None:
|
||||
installer = tmp_path / "src" / "steam-game-installer" / "run.sh"
|
||||
installer.parent.mkdir(parents=True)
|
||||
installer.write_text("#!/bin/bash\n")
|
||||
# The autouse guard points _INSTALLER at a dead absolute path; put the
|
||||
# real relative one back so the home join itself is what is tested.
|
||||
relative = Path("src", "steam-game-installer", "run.sh")
|
||||
with (
|
||||
patch.object(_fast_install, "_INSTALLER", relative),
|
||||
patch(f"{PKG}.pwd.getpwnam", return_value=SimpleNamespace(pw_dir=tmp_path)),
|
||||
):
|
||||
assert _fast_install._installer_path("kuhy") == installer
|
||||
|
||||
def test_missing_file_is_none(self, tmp_path: Path) -> None:
|
||||
with patch(
|
||||
f"{PKG}.pwd.getpwnam", return_value=SimpleNamespace(pw_dir=tmp_path)
|
||||
):
|
||||
assert _fast_install._installer_path("kuhy") is None
|
||||
|
||||
def test_unknown_user_is_none(self) -> None:
|
||||
with patch(f"{PKG}.pwd.getpwnam", side_effect=KeyError("nobody")):
|
||||
assert _fast_install._installer_path("nobody") is None
|
||||
|
||||
def test_no_user_uses_own_home(self, tmp_path: Path) -> None:
|
||||
with patch(f"{PKG}.Path.home", return_value=tmp_path):
|
||||
assert _fast_install._installer_path(None) is None
|
||||
|
||||
|
||||
class TestSteamAccountName:
|
||||
"""The username comes from Steam's own loginusers.vdf."""
|
||||
|
||||
def _write(self, content: str) -> None:
|
||||
config = _fast_install.STEAMAPPS_PATH.parent / "config"
|
||||
config.mkdir(parents=True, exist_ok=True)
|
||||
(config / "loginusers.vdf").write_text(content)
|
||||
|
||||
def test_reads_account_name(self) -> None:
|
||||
self._write('"users"\n{\n\t"7656"\n\t{\n\t\t"AccountName"\t\t"krzys"\n')
|
||||
assert _fast_install._steam_account_name() == "krzys"
|
||||
|
||||
def test_no_account_field(self) -> None:
|
||||
self._write('"users"\n{\n}\n')
|
||||
assert _fast_install._steam_account_name() is None
|
||||
|
||||
def test_missing_file(self) -> None:
|
||||
assert _fast_install._steam_account_name() is None
|
||||
|
||||
|
||||
class TestRefusal:
|
||||
"""Closing Steam is refused while it would destroy something."""
|
||||
|
||||
def test_game_running(self) -> None:
|
||||
with patch(f"{PKG}.game_is_running", return_value=True):
|
||||
assert "game is running" in (_fast_install._refusal(1) or "")
|
||||
|
||||
def test_other_update_in_progress(self) -> None:
|
||||
with (
|
||||
patch(f"{PKG}.game_is_running", return_value=False),
|
||||
patch(f"{PKG}.steam_update_in_progress", return_value=True) as update,
|
||||
):
|
||||
assert "download is in progress" in (_fast_install._refusal(7) or "")
|
||||
update.assert_called_once_with(exclude_app_id=7)
|
||||
|
||||
def test_safe(self) -> None:
|
||||
with (
|
||||
patch(f"{PKG}.game_is_running", return_value=False),
|
||||
patch(f"{PKG}.steam_update_in_progress", return_value=False),
|
||||
):
|
||||
assert _fast_install._refusal(7) is None
|
||||
|
||||
|
||||
class TestBuildCmd:
|
||||
"""The argv pins every choice the installer would otherwise prompt for."""
|
||||
|
||||
def test_with_account(self) -> None:
|
||||
with (
|
||||
patch(f"{PKG}._steam_account_name", return_value="krzys"),
|
||||
patch(f"{PKG}.desktop_user_cmd", side_effect=lambda cmd, _u: cmd),
|
||||
):
|
||||
cmd = _fast_install._build_cmd(Path("/i/run.sh"), 42, "kuhy")
|
||||
assert cmd == [
|
||||
"/i/run.sh",
|
||||
"--no-deps",
|
||||
"--appid",
|
||||
"42",
|
||||
"--yes",
|
||||
"--language",
|
||||
"english",
|
||||
"--skip-steamcmd",
|
||||
"--username",
|
||||
"krzys",
|
||||
]
|
||||
|
||||
def test_without_account_and_drops_privileges(self) -> None:
|
||||
with (
|
||||
patch(f"{PKG}._steam_account_name", return_value=None),
|
||||
patch(f"{PKG}.desktop_user_cmd", return_value=["wrapped"]) as wrap,
|
||||
):
|
||||
assert _fast_install._build_cmd(Path("/i/run.sh"), 42, "kuhy") == [
|
||||
"wrapped"
|
||||
]
|
||||
argv, user = wrap.call_args.args
|
||||
assert "--username" not in argv
|
||||
assert user == "kuhy"
|
||||
|
||||
|
||||
class TestIsFastInstalling:
|
||||
"""Only this process's own live runs count."""
|
||||
|
||||
def test_tracks_runs(self) -> None:
|
||||
assert _fast_install.is_fast_installing(5) is False
|
||||
_fast_install._RUNS.append(
|
||||
_fast_install._DetachedRun(5, MagicMock(), Path("/nonexistent"))
|
||||
)
|
||||
assert _fast_install.is_fast_installing(5) is True
|
||||
assert _fast_install.is_fast_installing(6) is False
|
||||
@ -1,179 +0,0 @@
|
||||
"""Tests for _fast_install's run lifecycle: spawn, poll, and fast_install.
|
||||
|
||||
The pure helpers live in test_fast_install_helpers.py to keep both files under
|
||||
the 250-line cap. Every subprocess here is a mock (see _no_subprocess.py).
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import signal
|
||||
from typing import TYPE_CHECKING
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from steam_backlog_enforcer import _fast_install, config
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pathlib import Path
|
||||
|
||||
PKG = "steam_backlog_enforcer._fast_install"
|
||||
|
||||
|
||||
def _run(app_id: int, returncode: int | None, log_path: Path) -> MagicMock:
|
||||
"""Register a fake detached run whose poll() answers *returncode*."""
|
||||
proc = MagicMock(pid=4321)
|
||||
proc.poll.return_value = returncode
|
||||
_fast_install._RUNS.append(_fast_install._DetachedRun(app_id, proc, log_path))
|
||||
return proc
|
||||
|
||||
|
||||
class TestPollFastInstalls:
|
||||
"""Detached runs are reaped, failures remembered, stalls interrupted."""
|
||||
|
||||
def test_success_is_reaped(self, tmp_path: Path) -> None:
|
||||
_run(1, 0, tmp_path / "log")
|
||||
_fast_install.poll_fast_installs()
|
||||
assert _fast_install._RUNS == []
|
||||
assert set() == _fast_install._FAILED
|
||||
|
||||
def test_failure_is_remembered(self, tmp_path: Path) -> None:
|
||||
_run(2, 3, tmp_path / "log")
|
||||
_fast_install.poll_fast_installs()
|
||||
assert _fast_install._RUNS == []
|
||||
assert {2} == _fast_install._FAILED
|
||||
|
||||
def test_live_and_chatty_is_left_alone(self, tmp_path: Path) -> None:
|
||||
log = tmp_path / "log"
|
||||
log.write_text("progress\n")
|
||||
_run(3, None, log)
|
||||
with patch(f"{PKG}.os.killpg") as killpg:
|
||||
_fast_install.poll_fast_installs()
|
||||
killpg.assert_not_called()
|
||||
assert _fast_install.is_fast_installing(3)
|
||||
|
||||
def test_live_without_log_is_left_alone(self, tmp_path: Path) -> None:
|
||||
_run(4, None, tmp_path / "missing.log")
|
||||
with patch(f"{PKG}.os.killpg") as killpg:
|
||||
_fast_install.poll_fast_installs()
|
||||
killpg.assert_not_called()
|
||||
|
||||
def test_stalled_run_gets_sigint(self, tmp_path: Path) -> None:
|
||||
log = tmp_path / "log"
|
||||
log.write_text("Enter account password: ")
|
||||
old = log.stat().st_mtime - _fast_install.STALL_SECONDS - 60
|
||||
os.utime(log, (old, old))
|
||||
_run(5, None, log)
|
||||
with patch(f"{PKG}.os.killpg") as killpg:
|
||||
_fast_install.poll_fast_installs()
|
||||
# SIGINT so the installer's `finally` restarts Steam; kept tracked
|
||||
# until it actually exits.
|
||||
killpg.assert_called_once_with(4321, signal.SIGINT)
|
||||
assert _fast_install.is_fast_installing(5)
|
||||
|
||||
|
||||
class TestSpawnDetached:
|
||||
"""The daemon's spawn: own session, no stdin, output to the log."""
|
||||
|
||||
def test_as_user_spawns_directly(self) -> None:
|
||||
with (
|
||||
patch(f"{PKG}.os.geteuid", return_value=1000),
|
||||
patch(f"{PKG}.subprocess.Popen") as popen,
|
||||
):
|
||||
_fast_install._spawn_detached(["run.sh"], 9)
|
||||
args, kwargs = popen.call_args
|
||||
assert args[0] == ["run.sh"]
|
||||
assert kwargs["stdin"] == _fast_install.subprocess.DEVNULL
|
||||
assert kwargs["start_new_session"] is True
|
||||
run = _fast_install._RUNS[0]
|
||||
assert run.app_id == 9
|
||||
assert run.log_path == config.CONFIG_DIR / "fast_install.log"
|
||||
assert run.log_path.exists()
|
||||
|
||||
def test_as_root_escapes_the_service_cgroup(self) -> None:
|
||||
with (
|
||||
patch(f"{PKG}.os.geteuid", return_value=0),
|
||||
patch(f"{PKG}.shutil.which", return_value="/usr/bin/systemd-run"),
|
||||
patch(f"{PKG}.subprocess.Popen") as popen,
|
||||
):
|
||||
_fast_install._spawn_detached(["run.sh"], 9)
|
||||
assert popen.call_args.args[0] == [
|
||||
"systemd-run",
|
||||
"--scope",
|
||||
"--quiet",
|
||||
"--collect",
|
||||
"run.sh",
|
||||
]
|
||||
|
||||
def test_as_root_without_systemd_run(self) -> None:
|
||||
with (
|
||||
patch(f"{PKG}.os.geteuid", return_value=0),
|
||||
patch(f"{PKG}.shutil.which", return_value=None),
|
||||
patch(f"{PKG}.subprocess.Popen") as popen,
|
||||
):
|
||||
_fast_install._spawn_detached(["run.sh"], 9)
|
||||
assert popen.call_args.args[0] == ["run.sh"]
|
||||
|
||||
|
||||
class TestFastInstall:
|
||||
"""fast_install picks a mode, or tells the caller to fall back."""
|
||||
|
||||
def _ready(self, tmp_path: Path) -> Path:
|
||||
installer = tmp_path / "run.sh"
|
||||
installer.write_text("#!/bin/bash\n")
|
||||
return installer
|
||||
|
||||
def test_previously_failed_goes_straight_to_fallback(self) -> None:
|
||||
_fast_install._FAILED.add(7)
|
||||
with patch(f"{PKG}._installer_path") as find:
|
||||
assert _fast_install.fast_install(7, "G") is False
|
||||
find.assert_not_called()
|
||||
|
||||
def test_no_installer(self) -> None:
|
||||
# The autouse guard already hides the real installer.
|
||||
assert _fast_install.fast_install(7, "G") is False
|
||||
|
||||
def test_refused(self, tmp_path: Path) -> None:
|
||||
with (
|
||||
patch(f"{PKG}._installer_path", return_value=self._ready(tmp_path)),
|
||||
patch(f"{PKG}._refusal", return_value="a game is running"),
|
||||
patch(f"{PKG}._echo") as echo,
|
||||
patch(f"{PKG}.subprocess.run") as run,
|
||||
):
|
||||
assert _fast_install.fast_install(7, "G") is False
|
||||
run.assert_not_called()
|
||||
assert "a game is running" in echo.call_args.args[0]
|
||||
|
||||
def test_no_terminal_spawns_detached(self, tmp_path: Path) -> None:
|
||||
with (
|
||||
patch(f"{PKG}._installer_path", return_value=self._ready(tmp_path)),
|
||||
patch(f"{PKG}._refusal", return_value=None),
|
||||
patch(f"{PKG}.sys.stdin.isatty", return_value=False),
|
||||
patch(f"{PKG}._spawn_detached") as spawn,
|
||||
patch(f"{PKG}.subprocess.run") as run,
|
||||
):
|
||||
assert _fast_install.fast_install(7, "G") is True
|
||||
spawn.assert_called_once()
|
||||
run.assert_not_called()
|
||||
|
||||
def test_terminal_runs_in_foreground(self, tmp_path: Path) -> None:
|
||||
with (
|
||||
patch(f"{PKG}._installer_path", return_value=self._ready(tmp_path)),
|
||||
patch(f"{PKG}._refusal", return_value=None),
|
||||
patch(f"{PKG}.sys.stdin.isatty", return_value=True),
|
||||
patch(f"{PKG}._echo"),
|
||||
patch(f"{PKG}.subprocess.run", return_value=MagicMock(returncode=0)),
|
||||
):
|
||||
assert _fast_install.fast_install(7, "G") is True
|
||||
assert set() == _fast_install._FAILED
|
||||
|
||||
def test_foreground_failure_falls_back(self, tmp_path: Path) -> None:
|
||||
with (
|
||||
patch(f"{PKG}._installer_path", return_value=self._ready(tmp_path)),
|
||||
patch(f"{PKG}._refusal", return_value=None),
|
||||
patch(f"{PKG}.sys.stdin.isatty", return_value=True),
|
||||
patch(f"{PKG}._echo") as echo,
|
||||
patch(f"{PKG}.subprocess.run", return_value=MagicMock(returncode=2)),
|
||||
):
|
||||
assert _fast_install.fast_install(7, "G") is False
|
||||
assert {7} == _fast_install._FAILED
|
||||
assert "exit 2" in echo.call_args.args[0]
|
||||
@ -23,13 +23,10 @@ class TestInstallGame:
|
||||
"""Tests for install_game."""
|
||||
|
||||
def test_already_installed(self, tmp_path: Path) -> None:
|
||||
(tmp_path / "appmanifest_440.acf").write_text('"StateFlags"\t\t"4"\n')
|
||||
with (
|
||||
patch("steam_backlog_enforcer._steam_state.STEAMAPPS_PATH", tmp_path),
|
||||
patch(f"{PKG}.fast_install") as fast,
|
||||
):
|
||||
manifest = tmp_path / "appmanifest_440.acf"
|
||||
manifest.touch()
|
||||
with patch("steam_backlog_enforcer.game_install.STEAMAPPS_PATH", tmp_path):
|
||||
assert install_game(440, "TF2", "steam123") is True
|
||||
fast.assert_not_called()
|
||||
|
||||
def test_use_steam_protocol_success(self, tmp_path: Path) -> None:
|
||||
with (
|
||||
|
||||
@ -85,7 +85,7 @@ class TestCmdInstall:
|
||||
def test_already_installed(self) -> None:
|
||||
state = State(current_app_id=1, current_game_name="G")
|
||||
with (
|
||||
patch(f"{PKG}.is_game_fully_installed", return_value=True),
|
||||
patch(f"{PKG}.is_game_installed", return_value=True),
|
||||
patch(f"{PKG}._echo"),
|
||||
):
|
||||
cmd_install(Config(), state)
|
||||
@ -93,7 +93,7 @@ class TestCmdInstall:
|
||||
def test_installs_ok(self) -> None:
|
||||
state = State(current_app_id=1, current_game_name="G")
|
||||
with (
|
||||
patch(f"{PKG}.is_game_fully_installed", return_value=False),
|
||||
patch(f"{PKG}.is_game_installed", return_value=False),
|
||||
patch(f"{PKG}.install_game", return_value=True),
|
||||
patch(f"{PKG}._echo"),
|
||||
):
|
||||
@ -102,7 +102,7 @@ class TestCmdInstall:
|
||||
def test_install_fails(self) -> None:
|
||||
state = State(current_app_id=1, current_game_name="G")
|
||||
with (
|
||||
patch(f"{PKG}.is_game_fully_installed", return_value=False),
|
||||
patch(f"{PKG}.is_game_installed", return_value=False),
|
||||
patch(f"{PKG}.install_game", return_value=False),
|
||||
patch(f"{PKG}._echo"),
|
||||
):
|
||||
|
||||
@ -38,14 +38,8 @@ class TestFinalizeCompletion:
|
||||
patch(f"{CMD_DONE_PKG}._echo"),
|
||||
patch(f"{CMD_DONE_PKG}.load_snapshot", return_value=snap),
|
||||
patch(f"{CMD_DONE_PKG}.pick_next_game") as mock_pick,
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[1, 2, 3],
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.try_hide_other_games",
|
||||
return_value=(2, None),
|
||||
),
|
||||
patch(f"{CMD_DONE_PKG}.get_all_owned_app_ids", return_value=[1, 2, 3]),
|
||||
patch(f"{CMD_DONE_PKG}.try_hide_other_games", return_value=(2, None)),
|
||||
patch(f"{CMD_DONE_PKG}.send_notification"),
|
||||
patch.object(State, "save"),
|
||||
):
|
||||
@ -71,19 +65,14 @@ class TestFinalizeCompletion:
|
||||
snap = [_snap(2, "NewGame", 10, 0, 5.0)]
|
||||
with (
|
||||
patch(f"{CMD_DONE_PKG}._echo") as mock_echo,
|
||||
# The skip line is printed by the shared hide helper.
|
||||
patch("steam_backlog_enforcer.library_hider._echo", mock_echo),
|
||||
patch(f"{CMD_DONE_PKG}.load_snapshot", return_value=snap),
|
||||
patch(f"{CMD_DONE_PKG}.pick_next_game") as mock_pick,
|
||||
patch(f"{CMD_DONE_PKG}.get_all_owned_app_ids", return_value=[1, 2, 3]),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[1, 2, 3],
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.try_hide_other_games",
|
||||
f"{CMD_DONE_PKG}.try_hide_other_games",
|
||||
return_value=(0, "update in progress"),
|
||||
),
|
||||
patch(f"{CMD_DONE_PKG}.is_game_fully_installed", return_value=True),
|
||||
patch(f"{CMD_DONE_PKG}.is_game_installed", return_value=True),
|
||||
patch(f"{CMD_DONE_PKG}.send_notification"),
|
||||
patch.object(State, "save"),
|
||||
):
|
||||
@ -144,10 +133,7 @@ class TestFinalizeCompletion:
|
||||
patch(f"{CMD_DONE_PKG}._echo"),
|
||||
patch(f"{CMD_DONE_PKG}.load_snapshot", return_value=snap),
|
||||
patch(f"{CMD_DONE_PKG}.pick_next_game") as mock_pick,
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[],
|
||||
),
|
||||
patch(f"{CMD_DONE_PKG}.get_all_owned_app_ids", return_value=[]),
|
||||
patch(f"{CMD_DONE_PKG}.send_notification"),
|
||||
patch.object(State, "save"),
|
||||
):
|
||||
@ -172,14 +158,8 @@ class TestFinalizeCompletion:
|
||||
patch(f"{CMD_DONE_PKG}._echo"),
|
||||
patch(f"{CMD_DONE_PKG}.load_snapshot", return_value=snap),
|
||||
patch(f"{CMD_DONE_PKG}.pick_next_game") as mock_pick,
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[1, 2],
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.try_hide_other_games",
|
||||
return_value=(0, None),
|
||||
),
|
||||
patch(f"{CMD_DONE_PKG}.get_all_owned_app_ids", return_value=[1, 2]),
|
||||
patch(f"{CMD_DONE_PKG}.try_hide_other_games", return_value=(0, None)),
|
||||
patch(f"{CMD_DONE_PKG}.send_notification"),
|
||||
patch.object(State, "save"),
|
||||
):
|
||||
|
||||
@ -50,15 +50,9 @@ class TestEnforceOnDone:
|
||||
return_value=[(1234, 999)],
|
||||
),
|
||||
patch(f"{CMD_DONE_PKG}.uninstall_other_games", return_value=2),
|
||||
patch(f"{CMD_DONE_PKG}.is_game_fully_installed", return_value=True),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[1, 2],
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.try_hide_other_games",
|
||||
return_value=(1, None),
|
||||
),
|
||||
patch(f"{CMD_DONE_PKG}.is_game_installed", return_value=True),
|
||||
patch(f"{CMD_DONE_PKG}.get_all_owned_app_ids", return_value=[1, 2]),
|
||||
patch(f"{CMD_DONE_PKG}.try_hide_other_games", return_value=(1, None)),
|
||||
):
|
||||
_enforce_on_done(config, state)
|
||||
|
||||
@ -72,15 +66,9 @@ class TestEnforceOnDone:
|
||||
patch(f"{CMD_DONE_PKG}._echo"),
|
||||
patch(f"{CMD_DONE_PKG}.enforce_allowed_game", return_value=[]),
|
||||
patch(f"{CMD_DONE_PKG}.uninstall_other_games", return_value=0),
|
||||
patch(f"{CMD_DONE_PKG}.is_game_fully_installed", return_value=True),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[],
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.try_hide_other_games",
|
||||
return_value=(0, None),
|
||||
),
|
||||
patch(f"{CMD_DONE_PKG}.is_game_installed", return_value=True),
|
||||
patch(f"{CMD_DONE_PKG}.get_all_owned_app_ids", return_value=[]),
|
||||
patch(f"{CMD_DONE_PKG}.try_hide_other_games", return_value=(0, None)),
|
||||
):
|
||||
_enforce_on_done(config, state)
|
||||
|
||||
@ -89,15 +77,10 @@ class TestEnforceOnDone:
|
||||
state = State(current_app_id=1, current_game_name="G")
|
||||
with (
|
||||
patch(f"{CMD_DONE_PKG}._echo") as mock_echo,
|
||||
# The skip line is printed by the shared hide helper.
|
||||
patch("steam_backlog_enforcer.library_hider._echo", mock_echo),
|
||||
patch(f"{CMD_DONE_PKG}.is_game_fully_installed", return_value=True),
|
||||
patch(f"{CMD_DONE_PKG}.is_game_installed", return_value=True),
|
||||
patch(f"{CMD_DONE_PKG}.get_all_owned_app_ids", return_value=[1, 2]),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[1, 2],
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.try_hide_other_games",
|
||||
f"{CMD_DONE_PKG}.try_hide_other_games",
|
||||
return_value=(0, "Steam is not installed"),
|
||||
),
|
||||
):
|
||||
@ -115,16 +98,10 @@ class TestEnforceOnDone:
|
||||
state = State(current_app_id=1, current_game_name="G")
|
||||
with (
|
||||
patch(f"{CMD_DONE_PKG}._echo"),
|
||||
patch(f"{CMD_DONE_PKG}.is_game_fully_installed", return_value=False),
|
||||
patch(f"{CMD_DONE_PKG}.is_game_installed", return_value=False),
|
||||
patch(f"{CMD_DONE_PKG}.install_game") as mock_install,
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[1, 2],
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.try_hide_other_games",
|
||||
return_value=(0, None),
|
||||
),
|
||||
patch(f"{CMD_DONE_PKG}.get_all_owned_app_ids", return_value=[1, 2]),
|
||||
patch(f"{CMD_DONE_PKG}.try_hide_other_games", return_value=(0, None)),
|
||||
):
|
||||
_enforce_on_done(config, state)
|
||||
mock_install.assert_called_once_with(1, "G", "s1", use_steam_protocol=True)
|
||||
|
||||
@ -93,15 +93,9 @@ class TestFinalizeCompletionRetries:
|
||||
patch(f"{CMD_DONE_PKG}._echo"),
|
||||
patch(f"{CMD_DONE_PKG}.load_snapshot", return_value=snap),
|
||||
patch(f"{CMD_DONE_PKG}.pick_next_game", side_effect=set_next),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[1, 2],
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.try_hide_other_games",
|
||||
return_value=(1, None),
|
||||
),
|
||||
patch(f"{CMD_DONE_PKG}.is_game_fully_installed", return_value=False),
|
||||
patch(f"{CMD_DONE_PKG}.get_all_owned_app_ids", return_value=[1, 2]),
|
||||
patch(f"{CMD_DONE_PKG}.try_hide_other_games", return_value=(1, None)),
|
||||
patch(f"{CMD_DONE_PKG}.is_game_installed", return_value=False),
|
||||
patch(f"{CMD_DONE_PKG}.install_game") as mock_install,
|
||||
patch(f"{CMD_DONE_PKG}.send_notification"),
|
||||
patch.object(State, "save"),
|
||||
@ -129,15 +123,9 @@ class TestFinalizeCompletionRetries:
|
||||
patch(f"{CMD_DONE_PKG}._echo"),
|
||||
patch(f"{CMD_DONE_PKG}.load_snapshot", return_value=snap),
|
||||
patch(f"{CMD_DONE_PKG}.pick_next_game", side_effect=set_next),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[1, 2],
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.try_hide_other_games",
|
||||
return_value=(1, None),
|
||||
),
|
||||
patch(f"{CMD_DONE_PKG}.is_game_fully_installed", return_value=True),
|
||||
patch(f"{CMD_DONE_PKG}.get_all_owned_app_ids", return_value=[1, 2]),
|
||||
patch(f"{CMD_DONE_PKG}.try_hide_other_games", return_value=(1, None)),
|
||||
patch(f"{CMD_DONE_PKG}.is_game_installed", return_value=True),
|
||||
patch(f"{CMD_DONE_PKG}.install_game") as mock_install,
|
||||
patch(f"{CMD_DONE_PKG}.send_notification"),
|
||||
patch.object(State, "save"),
|
||||
|
||||
@ -27,11 +27,8 @@ class TestPickManualCap:
|
||||
patch("builtins.input", return_value="YES"),
|
||||
patch.object(State, "save"),
|
||||
patch(f"{PKG}.uninstall_other_games", return_value=0),
|
||||
patch(f"{PKG}.is_game_fully_installed", return_value=True),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[],
|
||||
),
|
||||
patch(f"{PKG}.is_game_installed", return_value=True),
|
||||
patch(f"{PKG}.get_all_owned_app_ids", return_value=[]),
|
||||
):
|
||||
cmd_pick_manual(Config(max_manual_picks=2), state, ["489830"])
|
||||
assert [p["app_id"] for p in state.manual_picks] == [100, 489830]
|
||||
@ -61,11 +58,8 @@ class TestPickManualCap:
|
||||
patch("builtins.input", return_value="YES"),
|
||||
patch.object(State, "save"),
|
||||
patch(f"{PKG}.uninstall_other_games", return_value=0),
|
||||
patch(f"{PKG}.is_game_fully_installed", return_value=True),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[],
|
||||
),
|
||||
patch(f"{PKG}.is_game_installed", return_value=True),
|
||||
patch(f"{PKG}.get_all_owned_app_ids", return_value=[]),
|
||||
pytest.raises(SystemExit),
|
||||
):
|
||||
cmd_pick_manual(Config(max_manual_picks=2), state, ["489830"])
|
||||
@ -84,15 +78,9 @@ class TestPickManualCap:
|
||||
patch("builtins.input", return_value="YES"),
|
||||
patch.object(State, "save"),
|
||||
patch(f"{PKG}.uninstall_other_games", return_value=0) as mock_uninstall,
|
||||
patch(f"{PKG}.is_game_fully_installed", return_value=True),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[1, 100, 489830],
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.try_hide_other_games",
|
||||
return_value=(1, None),
|
||||
) as mock_hide,
|
||||
patch(f"{PKG}.is_game_installed", return_value=True),
|
||||
patch(f"{PKG}.get_all_owned_app_ids", return_value=[1, 100, 489830]),
|
||||
patch(f"{PKG}.try_hide_other_games", return_value=(1, None)) as mock_hide,
|
||||
):
|
||||
cmd_pick_manual(Config(max_manual_picks=2), state, ["489830"])
|
||||
mock_uninstall.assert_called_once_with({100, 489830})
|
||||
@ -107,12 +95,9 @@ class TestPickManualCap:
|
||||
patch("builtins.input", return_value="YES"),
|
||||
patch.object(State, "save"),
|
||||
patch(f"{PKG}.uninstall_other_games", return_value=0),
|
||||
patch(f"{PKG}.is_game_fully_installed", return_value=False),
|
||||
patch(f"{PKG}.is_game_installed", return_value=False),
|
||||
patch(f"{PKG}.install_game") as mock_install,
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[],
|
||||
),
|
||||
patch(f"{PKG}.get_all_owned_app_ids", return_value=[]),
|
||||
):
|
||||
cmd_pick_manual(Config(max_manual_picks=2), state, ["489830"])
|
||||
installed = {call.args[0] for call in mock_install.call_args_list}
|
||||
|
||||
@ -11,6 +11,16 @@ PKG = "steam_backlog_enforcer.main.picks"
|
||||
|
||||
|
||||
class TestCmdPickManual:
|
||||
def _base_patches(self) -> dict[str, object]:
|
||||
return {
|
||||
f"{PKG}._resolve_game_name": "Skyrim SE",
|
||||
f"{PKG}.uninstall_other_games": 2,
|
||||
f"{PKG}.is_game_installed": False,
|
||||
f"{PKG}.install_game": None,
|
||||
f"{PKG}.get_all_owned_app_ids": [1, 2, 489830],
|
||||
f"{PKG}.try_hide_other_games": (2, None),
|
||||
}
|
||||
|
||||
def test_invalid_app_id(self) -> None:
|
||||
with patch(f"{PKG}._echo") as mock_echo:
|
||||
cmd_pick_manual(Config(), State(), ["abc"])
|
||||
@ -44,11 +54,8 @@ class TestCmdPickManual:
|
||||
patch("builtins.input", side_effect=["489830", "YES"]),
|
||||
patch.object(State, "save"),
|
||||
patch(f"{PKG}.uninstall_other_games", return_value=0),
|
||||
patch(f"{PKG}.is_game_fully_installed", return_value=True),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[],
|
||||
),
|
||||
patch(f"{PKG}.is_game_installed", return_value=True),
|
||||
patch(f"{PKG}.get_all_owned_app_ids", return_value=[]),
|
||||
):
|
||||
cmd_pick_manual(Config(), state, [])
|
||||
assert state.current_app_id == 489830
|
||||
@ -62,16 +69,10 @@ class TestCmdPickManual:
|
||||
patch("builtins.input", return_value="YES"),
|
||||
patch.object(State, "save") as mock_save,
|
||||
patch(f"{PKG}.uninstall_other_games", return_value=2) as mock_uninstall,
|
||||
patch(f"{PKG}.is_game_fully_installed", return_value=False),
|
||||
patch(f"{PKG}.is_game_installed", return_value=False),
|
||||
patch(f"{PKG}.install_game") as mock_install,
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[1, 489830],
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.try_hide_other_games",
|
||||
return_value=(1, None),
|
||||
) as mock_hide,
|
||||
patch(f"{PKG}.get_all_owned_app_ids", return_value=[1, 489830]),
|
||||
patch(f"{PKG}.try_hide_other_games", return_value=(1, None)) as mock_hide,
|
||||
):
|
||||
cmd_pick_manual(config, state, ["489830"])
|
||||
|
||||
@ -84,6 +85,67 @@ class TestCmdPickManual:
|
||||
mock_install.assert_called_once()
|
||||
mock_hide.assert_called_once()
|
||||
|
||||
def test_no_uninstall_when_config_off(self) -> None:
|
||||
state = State()
|
||||
config = Config(uninstall_other_games=False)
|
||||
with (
|
||||
patch(f"{PKG}._resolve_game_name", return_value="Skyrim SE"),
|
||||
patch(f"{PKG}._echo"),
|
||||
patch("builtins.input", return_value="YES"),
|
||||
patch.object(State, "save"),
|
||||
patch(f"{PKG}.uninstall_other_games") as mock_uninstall,
|
||||
patch(f"{PKG}.is_game_installed", return_value=True),
|
||||
patch(f"{PKG}.get_all_owned_app_ids", return_value=[]),
|
||||
):
|
||||
cmd_pick_manual(config, state, ["489830"])
|
||||
mock_uninstall.assert_not_called()
|
||||
|
||||
def test_game_already_installed_skips_install(self) -> None:
|
||||
state = State()
|
||||
with (
|
||||
patch(f"{PKG}._resolve_game_name", return_value="Skyrim SE"),
|
||||
patch(f"{PKG}._echo"),
|
||||
patch("builtins.input", return_value="YES"),
|
||||
patch.object(State, "save"),
|
||||
patch(f"{PKG}.uninstall_other_games", return_value=0),
|
||||
patch(f"{PKG}.is_game_installed", return_value=True),
|
||||
patch(f"{PKG}.install_game") as mock_install,
|
||||
patch(f"{PKG}.get_all_owned_app_ids", return_value=[]),
|
||||
):
|
||||
cmd_pick_manual(Config(), state, ["489830"])
|
||||
mock_install.assert_not_called()
|
||||
|
||||
def test_no_hide_when_no_owned_ids(self) -> None:
|
||||
state = State()
|
||||
with (
|
||||
patch(f"{PKG}._resolve_game_name", return_value="Skyrim SE"),
|
||||
patch(f"{PKG}._echo"),
|
||||
patch("builtins.input", return_value="YES"),
|
||||
patch.object(State, "save"),
|
||||
patch(f"{PKG}.uninstall_other_games", return_value=0),
|
||||
patch(f"{PKG}.is_game_installed", return_value=True),
|
||||
patch(f"{PKG}.get_all_owned_app_ids", return_value=[]),
|
||||
patch(f"{PKG}.try_hide_other_games") as mock_hide,
|
||||
):
|
||||
cmd_pick_manual(Config(), state, ["489830"])
|
||||
mock_hide.assert_not_called()
|
||||
|
||||
def test_uninstall_returns_zero_no_echo(self) -> None:
|
||||
state = State()
|
||||
config = Config(uninstall_other_games=True)
|
||||
with (
|
||||
patch(f"{PKG}._resolve_game_name", return_value="Skyrim SE"),
|
||||
patch(f"{PKG}._echo") as mock_echo,
|
||||
patch("builtins.input", return_value="YES"),
|
||||
patch.object(State, "save"),
|
||||
patch(f"{PKG}.uninstall_other_games", return_value=0),
|
||||
patch(f"{PKG}.is_game_installed", return_value=True),
|
||||
patch(f"{PKG}.get_all_owned_app_ids", return_value=[]),
|
||||
):
|
||||
cmd_pick_manual(config, state, ["489830"])
|
||||
output = " ".join(str(c) for c in mock_echo.call_args_list)
|
||||
assert "Uninstalled 0" not in output
|
||||
|
||||
def test_enforcement_started_at_set_when_empty(self) -> None:
|
||||
state = State(enforcement_started_at="")
|
||||
with (
|
||||
@ -92,11 +154,8 @@ class TestCmdPickManual:
|
||||
patch("builtins.input", return_value="YES"),
|
||||
patch.object(State, "save"),
|
||||
patch(f"{PKG}.uninstall_other_games", return_value=0),
|
||||
patch(f"{PKG}.is_game_fully_installed", return_value=True),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[],
|
||||
),
|
||||
patch(f"{PKG}.is_game_installed", return_value=True),
|
||||
patch(f"{PKG}.get_all_owned_app_ids", return_value=[]),
|
||||
):
|
||||
cmd_pick_manual(Config(), state, ["489830"])
|
||||
assert state.enforcement_started_at != ""
|
||||
@ -110,11 +169,52 @@ class TestCmdPickManual:
|
||||
patch("builtins.input", return_value="YES"),
|
||||
patch.object(State, "save"),
|
||||
patch(f"{PKG}.uninstall_other_games", return_value=0),
|
||||
patch(f"{PKG}.is_game_fully_installed", return_value=True),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[],
|
||||
),
|
||||
patch(f"{PKG}.is_game_installed", return_value=True),
|
||||
patch(f"{PKG}.get_all_owned_app_ids", return_value=[]),
|
||||
):
|
||||
cmd_pick_manual(Config(), state, ["489830"])
|
||||
assert state.enforcement_started_at == existing_ts
|
||||
|
||||
def test_hide_returns_zero_no_echo(self) -> None:
|
||||
state = State()
|
||||
with (
|
||||
patch(f"{PKG}._resolve_game_name", return_value="Skyrim SE"),
|
||||
patch(f"{PKG}._echo") as mock_echo,
|
||||
patch("builtins.input", return_value="YES"),
|
||||
patch.object(State, "save"),
|
||||
patch(f"{PKG}.uninstall_other_games", return_value=0),
|
||||
patch(f"{PKG}.is_game_installed", return_value=True),
|
||||
patch(f"{PKG}.get_all_owned_app_ids", return_value=[1, 2]),
|
||||
patch(f"{PKG}.try_hide_other_games", return_value=(0, None)),
|
||||
):
|
||||
cmd_pick_manual(Config(), state, ["489830"])
|
||||
output = " ".join(str(c) for c in mock_echo.call_args_list)
|
||||
assert "Library: hid" not in output
|
||||
|
||||
def test_unreachable_steam_reports_skip(self) -> None:
|
||||
# The pick itself must survive a Steam that cannot be driven: this
|
||||
# used to abort cmd_pick_manual with a traceback after the pick had
|
||||
# already been saved.
|
||||
state = State()
|
||||
with (
|
||||
patch(f"{PKG}._resolve_game_name", return_value="Skyrim SE"),
|
||||
patch(f"{PKG}._echo") as mock_echo,
|
||||
patch("builtins.input", return_value="YES"),
|
||||
patch.object(State, "save"),
|
||||
patch(f"{PKG}.uninstall_other_games", return_value=0),
|
||||
patch(f"{PKG}.is_game_installed", return_value=True),
|
||||
patch(f"{PKG}.get_all_owned_app_ids", return_value=[1, 2]),
|
||||
patch(
|
||||
f"{PKG}.try_hide_other_games",
|
||||
return_value=(0, "update in progress"),
|
||||
),
|
||||
):
|
||||
cmd_pick_manual(Config(), state, ["489830"])
|
||||
output = " ".join(str(c) for c in mock_echo.call_args_list)
|
||||
assert "skipped (update in progress)" in output
|
||||
assert [p["app_id"] for p in state.manual_picks] == [489830]
|
||||
|
||||
|
||||
# ──────────────────────────────────────────────────────────────
|
||||
# main() dispatch to pick-manual
|
||||
# ──────────────────────────────────────────────────────────────
|
||||
|
||||
@ -1,146 +0,0 @@
|
||||
"""Tests for pick-manual's post-confirmation cascade.
|
||||
|
||||
Uninstall, install and library hiding after a confirmed pick. Split from
|
||||
test_main_pick_manual.py (prompting and state) to keep both under 250 lines.
|
||||
"""
|
||||
|
||||
from unittest.mock import patch
|
||||
|
||||
from steam_backlog_enforcer.config import Config, State
|
||||
from steam_backlog_enforcer.main import (
|
||||
cmd_pick_manual,
|
||||
)
|
||||
|
||||
PKG = "steam_backlog_enforcer.main.picks"
|
||||
|
||||
|
||||
class TestPickManualCascade:
|
||||
def test_no_uninstall_when_config_off(self) -> None:
|
||||
state = State()
|
||||
config = Config(uninstall_other_games=False)
|
||||
with (
|
||||
patch(f"{PKG}._resolve_game_name", return_value="Skyrim SE"),
|
||||
patch(f"{PKG}._echo"),
|
||||
patch("builtins.input", return_value="YES"),
|
||||
patch.object(State, "save"),
|
||||
patch(f"{PKG}.uninstall_other_games") as mock_uninstall,
|
||||
patch(f"{PKG}.is_game_fully_installed", return_value=True),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[],
|
||||
),
|
||||
):
|
||||
cmd_pick_manual(config, state, ["489830"])
|
||||
mock_uninstall.assert_not_called()
|
||||
|
||||
def test_game_already_installed_skips_install(self) -> None:
|
||||
state = State()
|
||||
with (
|
||||
patch(f"{PKG}._resolve_game_name", return_value="Skyrim SE"),
|
||||
patch(f"{PKG}._echo"),
|
||||
patch("builtins.input", return_value="YES"),
|
||||
patch.object(State, "save"),
|
||||
patch(f"{PKG}.uninstall_other_games", return_value=0),
|
||||
patch(f"{PKG}.is_game_fully_installed", return_value=True),
|
||||
patch(f"{PKG}.install_game") as mock_install,
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[],
|
||||
),
|
||||
):
|
||||
cmd_pick_manual(Config(), state, ["489830"])
|
||||
mock_install.assert_not_called()
|
||||
|
||||
def test_no_hide_when_no_owned_ids(self) -> None:
|
||||
state = State()
|
||||
with (
|
||||
patch(f"{PKG}._resolve_game_name", return_value="Skyrim SE"),
|
||||
patch(f"{PKG}._echo"),
|
||||
patch("builtins.input", return_value="YES"),
|
||||
patch.object(State, "save"),
|
||||
patch(f"{PKG}.uninstall_other_games", return_value=0),
|
||||
patch(f"{PKG}.is_game_fully_installed", return_value=True),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[],
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.try_hide_other_games"
|
||||
) as mock_hide,
|
||||
):
|
||||
cmd_pick_manual(Config(), state, ["489830"])
|
||||
mock_hide.assert_not_called()
|
||||
|
||||
def test_uninstall_returns_zero_no_echo(self) -> None:
|
||||
state = State()
|
||||
config = Config(uninstall_other_games=True)
|
||||
with (
|
||||
patch(f"{PKG}._resolve_game_name", return_value="Skyrim SE"),
|
||||
patch(f"{PKG}._echo") as mock_echo,
|
||||
patch("builtins.input", return_value="YES"),
|
||||
patch.object(State, "save"),
|
||||
patch(f"{PKG}.uninstall_other_games", return_value=0),
|
||||
patch(f"{PKG}.is_game_fully_installed", return_value=True),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[],
|
||||
),
|
||||
):
|
||||
cmd_pick_manual(config, state, ["489830"])
|
||||
output = " ".join(str(c) for c in mock_echo.call_args_list)
|
||||
assert "Uninstalled 0" not in output
|
||||
|
||||
def test_hide_returns_zero_no_echo(self) -> None:
|
||||
state = State()
|
||||
with (
|
||||
patch(f"{PKG}._resolve_game_name", return_value="Skyrim SE"),
|
||||
patch(f"{PKG}._echo") as mock_echo,
|
||||
patch("builtins.input", return_value="YES"),
|
||||
patch.object(State, "save"),
|
||||
patch(f"{PKG}.uninstall_other_games", return_value=0),
|
||||
patch(f"{PKG}.is_game_fully_installed", return_value=True),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[1, 2],
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.try_hide_other_games",
|
||||
return_value=(0, None),
|
||||
),
|
||||
):
|
||||
cmd_pick_manual(Config(), state, ["489830"])
|
||||
output = " ".join(str(c) for c in mock_echo.call_args_list)
|
||||
assert "Library: hid" not in output
|
||||
|
||||
def test_unreachable_steam_reports_skip(self) -> None:
|
||||
# The pick itself must survive a Steam that cannot be driven: this
|
||||
# used to abort cmd_pick_manual with a traceback after the pick had
|
||||
# already been saved.
|
||||
state = State()
|
||||
with (
|
||||
patch(f"{PKG}._resolve_game_name", return_value="Skyrim SE"),
|
||||
patch(f"{PKG}._echo") as mock_echo,
|
||||
# The skip line is printed by the shared hide helper.
|
||||
patch("steam_backlog_enforcer.library_hider._echo", mock_echo),
|
||||
patch("builtins.input", return_value="YES"),
|
||||
patch.object(State, "save"),
|
||||
patch(f"{PKG}.uninstall_other_games", return_value=0),
|
||||
patch(f"{PKG}.is_game_fully_installed", return_value=True),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[1, 2],
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.try_hide_other_games",
|
||||
return_value=(0, "update in progress"),
|
||||
),
|
||||
):
|
||||
cmd_pick_manual(Config(), state, ["489830"])
|
||||
output = " ".join(str(c) for c in mock_echo.call_args_list)
|
||||
assert "skipped (update in progress)" in output
|
||||
assert [p["app_id"] for p in state.manual_picks] == [489830]
|
||||
|
||||
|
||||
# ──────────────────────────────────────────────────────────────
|
||||
# main() dispatch to pick-manual
|
||||
# ──────────────────────────────────────────────────────────────
|
||||
@ -34,10 +34,7 @@ class TestCmdPick:
|
||||
patch(f"{PKG}.load_snapshot", return_value=snapshot),
|
||||
patch(f"{PKG}.load_hltb_cache", return_value={2: 5.0}),
|
||||
patch(f"{PKG}.pick_next_game") as mock_pick,
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[],
|
||||
),
|
||||
patch(f"{PKG}.get_all_owned_app_ids", return_value=[]),
|
||||
):
|
||||
config = Config(steam_api_key="k", steam_id="i")
|
||||
state = State()
|
||||
@ -51,14 +48,8 @@ class TestCmdPick:
|
||||
patch(f"{PKG}.load_snapshot", return_value=snapshot),
|
||||
patch(f"{PKG}.load_hltb_cache", return_value={2: 5.0}),
|
||||
patch(f"{PKG}.pick_next_game"),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[1, 2, 3],
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.try_hide_other_games",
|
||||
return_value=(2, None),
|
||||
) as mock_hide,
|
||||
patch(f"{PKG}.get_all_owned_app_ids", return_value=[1, 2, 3]),
|
||||
patch(f"{PKG}.try_hide_other_games", return_value=(2, None)) as mock_hide,
|
||||
patch(f"{PKG}._echo"),
|
||||
):
|
||||
cmd_pick(Config(steam_api_key="k", steam_id="i"), state)
|
||||
@ -71,14 +62,8 @@ class TestCmdPick:
|
||||
patch(f"{PKG}.load_snapshot", return_value=snapshot),
|
||||
patch(f"{PKG}.load_hltb_cache", return_value={}),
|
||||
patch(f"{PKG}.pick_next_game"),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[1, 2, 3],
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.try_hide_other_games",
|
||||
return_value=(0, None),
|
||||
),
|
||||
patch(f"{PKG}.get_all_owned_app_ids", return_value=[1, 2, 3]),
|
||||
patch(f"{PKG}.try_hide_other_games", return_value=(0, None)),
|
||||
patch(f"{PKG}._echo") as mock_echo,
|
||||
):
|
||||
cmd_pick(Config(steam_api_key="k", steam_id="i"), state)
|
||||
@ -91,17 +76,12 @@ class TestCmdPick:
|
||||
patch(f"{PKG}.load_snapshot", return_value=snapshot),
|
||||
patch(f"{PKG}.load_hltb_cache", return_value={}),
|
||||
patch(f"{PKG}.pick_next_game"),
|
||||
patch(f"{PKG}.get_all_owned_app_ids", return_value=[1, 2, 3]),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[1, 2, 3],
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.try_hide_other_games",
|
||||
f"{PKG}.try_hide_other_games",
|
||||
return_value=(0, "Steam is not installed"),
|
||||
),
|
||||
patch(f"{PKG}._echo") as mock_echo,
|
||||
# The skip line is printed by the shared hide helper.
|
||||
patch("steam_backlog_enforcer.library_hider._echo", mock_echo),
|
||||
):
|
||||
cmd_pick(Config(steam_api_key="k", steam_id="i"), state)
|
||||
output = " ".join(str(c) for c in mock_echo.call_args_list)
|
||||
@ -113,9 +93,7 @@ class TestCmdPick:
|
||||
patch(f"{PKG}.load_snapshot", return_value=snapshot),
|
||||
patch(f"{PKG}.load_hltb_cache", return_value={}),
|
||||
patch(f"{PKG}.pick_next_game"),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids"
|
||||
) as mock_owned,
|
||||
patch(f"{PKG}.get_all_owned_app_ids") as mock_owned,
|
||||
):
|
||||
cmd_pick(Config(steam_api_key="k", steam_id="i"), State())
|
||||
mock_owned.assert_not_called()
|
||||
@ -127,13 +105,8 @@ class TestCmdPick:
|
||||
patch(f"{PKG}.load_snapshot", return_value=snapshot),
|
||||
patch(f"{PKG}.load_hltb_cache", return_value={}),
|
||||
patch(f"{PKG}.pick_next_game"),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[],
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.try_hide_other_games"
|
||||
) as mock_hide,
|
||||
patch(f"{PKG}.get_all_owned_app_ids", return_value=[]),
|
||||
patch(f"{PKG}.try_hide_other_games") as mock_hide,
|
||||
):
|
||||
cmd_pick(Config(steam_api_key="k", steam_id="i"), state)
|
||||
mock_hide.assert_not_called()
|
||||
@ -151,10 +124,7 @@ class TestCmdPick:
|
||||
patch(f"{PKG}.load_snapshot", return_value=snapshot),
|
||||
patch(f"{PKG}.load_hltb_cache", return_value={2: 7.5}),
|
||||
patch(f"{PKG}.pick_next_game", side_effect=capture_pick),
|
||||
patch(
|
||||
"steam_backlog_enforcer.library_hider.get_all_owned_app_ids",
|
||||
return_value=[],
|
||||
),
|
||||
patch(f"{PKG}.get_all_owned_app_ids", return_value=[]),
|
||||
):
|
||||
cmd_pick(config, state)
|
||||
|
||||
@ -173,9 +143,7 @@ class TestResolveGameName:
|
||||
"playtime_minutes": 0,
|
||||
}
|
||||
]
|
||||
with patch(
|
||||
"steam_backlog_enforcer._snapshot.load_snapshot", return_value=snapshot
|
||||
):
|
||||
with patch(f"{PKG}.load_snapshot", return_value=snapshot):
|
||||
result = _resolve_game_name(Config(), 440)
|
||||
assert result == "TF2"
|
||||
|
||||
|
||||
@ -49,10 +49,9 @@ class TestCmdList:
|
||||
|
||||
def test_no_snapshot(self) -> None:
|
||||
with (
|
||||
patch("steam_backlog_enforcer._snapshot.load_snapshot", return_value=None),
|
||||
patch(f"{PKG}.load_snapshot", return_value=None),
|
||||
patch(f"{PKG}.report_completion", return_value=[]),
|
||||
# The "run scan" hint is printed by the shared snapshot helper.
|
||||
patch("steam_backlog_enforcer._snapshot._echo") as mock_echo,
|
||||
patch(f"{PKG}._echo") as mock_echo,
|
||||
):
|
||||
cmd_list(Config(), State())
|
||||
assert any("No snapshot" in str(c) for c in mock_echo.call_args_list)
|
||||
@ -65,9 +64,7 @@ class TestCmdList:
|
||||
]
|
||||
state = State(current_app_id=1)
|
||||
with (
|
||||
patch(
|
||||
"steam_backlog_enforcer._snapshot.load_snapshot", return_value=snapshot
|
||||
),
|
||||
patch(f"{PKG}.load_snapshot", return_value=snapshot),
|
||||
patch(f"{PKG}.report_completion", return_value=[]),
|
||||
patch(f"{PKG}._echo"),
|
||||
):
|
||||
@ -76,9 +73,7 @@ class TestCmdList:
|
||||
def test_many_games(self) -> None:
|
||||
snapshot = [snap(i, f"Game{i}") for i in range(60)]
|
||||
with (
|
||||
patch(
|
||||
"steam_backlog_enforcer._snapshot.load_snapshot", return_value=snapshot
|
||||
),
|
||||
patch(f"{PKG}.load_snapshot", return_value=snapshot),
|
||||
patch(f"{PKG}.report_completion", return_value=[]),
|
||||
patch(f"{PKG}._echo") as mock_echo,
|
||||
):
|
||||
|
||||
@ -6,6 +6,7 @@ from unittest.mock import patch
|
||||
|
||||
from steam_backlog_enforcer import _mcp_actions as mcp_actions
|
||||
from steam_backlog_enforcer import _mcp_query as mcp_query
|
||||
from steam_backlog_enforcer import _mcp_server as mcp_server
|
||||
from steam_backlog_enforcer.steam_api import GameInfo
|
||||
|
||||
|
||||
@ -119,16 +120,14 @@ class TestListBacklog:
|
||||
|
||||
class TestResolveAndSort:
|
||||
def test_resolve_found(self) -> None:
|
||||
with patch(
|
||||
"steam_backlog_enforcer._snapshot.load_snapshot",
|
||||
return_value=[{"app_id": 440, "name": "TF2"}],
|
||||
with patch.object(
|
||||
mcp_server, "load_snapshot", return_value=[{"app_id": 440, "name": "TF2"}]
|
||||
):
|
||||
assert mcp_actions._resolve_game_name(440) == "TF2"
|
||||
|
||||
def test_resolve_missing(self) -> None:
|
||||
with patch(
|
||||
"steam_backlog_enforcer._snapshot.load_snapshot",
|
||||
return_value=[{"app_id": 1, "name": "X"}],
|
||||
with patch.object(
|
||||
mcp_server, "load_snapshot", return_value=[{"app_id": 1, "name": "X"}]
|
||||
):
|
||||
assert mcp_actions._resolve_game_name(440) is None
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ from unittest.mock import patch
|
||||
|
||||
from steam_backlog_enforcer import _mcp_actions as mcp_actions
|
||||
from steam_backlog_enforcer import _mcp_query as mcp_query
|
||||
from steam_backlog_enforcer import _mcp_server as mcp_server
|
||||
from steam_backlog_enforcer.config import State
|
||||
|
||||
|
||||
@ -19,11 +20,12 @@ class TestPickManualGate:
|
||||
|
||||
def test_preview_does_not_mutate(self) -> None:
|
||||
with (
|
||||
patch(
|
||||
"steam_backlog_enforcer._snapshot.load_snapshot",
|
||||
patch.object(
|
||||
mcp_server,
|
||||
"load_snapshot",
|
||||
return_value=[{"app_id": 440, "name": "TF2"}],
|
||||
),
|
||||
patch("steam_backlog_enforcer._actions.apply_manual_pick") as amp,
|
||||
patch.object(mcp_actions, "apply_manual_pick") as amp,
|
||||
):
|
||||
out = mcp_actions.pick_manual(440)
|
||||
assert out["preview"] is True
|
||||
@ -32,15 +34,14 @@ class TestPickManualGate:
|
||||
|
||||
def test_confirm_applies(self) -> None:
|
||||
with (
|
||||
patch(
|
||||
"steam_backlog_enforcer._snapshot.load_snapshot",
|
||||
patch.object(
|
||||
mcp_server,
|
||||
"load_snapshot",
|
||||
return_value=[{"app_id": 440, "name": "TF2"}],
|
||||
),
|
||||
patch.object(mcp_actions, "State") as state,
|
||||
patch.object(mcp_actions, "Config") as config,
|
||||
patch(
|
||||
"steam_backlog_enforcer._actions.apply_manual_pick", return_value=None
|
||||
) as amp,
|
||||
patch.object(mcp_actions, "apply_manual_pick", return_value=None) as amp,
|
||||
):
|
||||
out = mcp_actions.pick_manual(440, confirm=True)
|
||||
assert out["applied"] is True
|
||||
@ -112,16 +113,14 @@ class TestAbandonPickGate:
|
||||
|
||||
def test_refused_at_cap(self) -> None:
|
||||
with (
|
||||
patch(
|
||||
"steam_backlog_enforcer._snapshot.load_snapshot",
|
||||
patch.object(
|
||||
mcp_server,
|
||||
"load_snapshot",
|
||||
return_value=[{"app_id": 440, "name": "TF2"}],
|
||||
),
|
||||
patch.object(mcp_actions, "State"),
|
||||
patch.object(mcp_actions, "Config"),
|
||||
patch(
|
||||
"steam_backlog_enforcer._actions.apply_manual_pick",
|
||||
return_value="cap reached",
|
||||
),
|
||||
patch.object(mcp_actions, "apply_manual_pick", return_value="cap reached"),
|
||||
):
|
||||
out = mcp_actions.pick_manual(440, confirm=True)
|
||||
assert out["ok"] is False
|
||||
|
||||
@ -63,7 +63,7 @@ class TestPickNextGameGroup2:
|
||||
),
|
||||
patch("steam_backlog_enforcer.scanning._echo"),
|
||||
patch(
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_fully_installed",
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_installed",
|
||||
return_value=True,
|
||||
),
|
||||
patch(
|
||||
@ -100,7 +100,7 @@ class TestPickNextGameGroup2:
|
||||
),
|
||||
patch("steam_backlog_enforcer.scanning._echo"),
|
||||
patch(
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_fully_installed",
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_installed",
|
||||
return_value=True,
|
||||
),
|
||||
patch(
|
||||
@ -127,7 +127,7 @@ class TestPickNextGameGroup2:
|
||||
),
|
||||
patch("steam_backlog_enforcer.scanning._echo"),
|
||||
patch(
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_fully_installed",
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_installed",
|
||||
return_value=True,
|
||||
),
|
||||
patch(
|
||||
@ -155,7 +155,7 @@ class TestPickNextGameGroup2:
|
||||
side_effect=lambda *a, **_: echoed.append(a[0]),
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_fully_installed",
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_installed",
|
||||
return_value=True,
|
||||
),
|
||||
patch(
|
||||
@ -184,7 +184,7 @@ class TestPickNextGameGroup2:
|
||||
side_effect=lambda *a, **_: echoed.append(a[0]),
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_fully_installed",
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_installed",
|
||||
return_value=True,
|
||||
),
|
||||
patch(
|
||||
|
||||
@ -66,7 +66,7 @@ class TestPickNextGame:
|
||||
side_effect=lambda *a, **_: echoed.append(a[0]),
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_fully_installed",
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_installed",
|
||||
return_value=True,
|
||||
),
|
||||
patch(
|
||||
@ -101,7 +101,7 @@ class TestPickNextGame:
|
||||
),
|
||||
patch("steam_backlog_enforcer.scanning._echo"),
|
||||
patch(
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_fully_installed",
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_installed",
|
||||
return_value=True,
|
||||
),
|
||||
patch(
|
||||
|
||||
@ -52,7 +52,7 @@ class TestPickNextGame:
|
||||
patch("steam_backlog_enforcer.scanning._echo"),
|
||||
patch("steam_backlog_enforcer._scanning_confidence._echo"),
|
||||
patch(
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_fully_installed",
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_installed",
|
||||
return_value=True,
|
||||
),
|
||||
patch(
|
||||
@ -86,7 +86,7 @@ class TestPickNextGame:
|
||||
),
|
||||
patch("steam_backlog_enforcer.scanning._echo"),
|
||||
patch(
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_fully_installed",
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_installed",
|
||||
return_value=True,
|
||||
),
|
||||
patch(
|
||||
@ -130,7 +130,7 @@ class TestPickNextGame:
|
||||
return_value=2,
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_fully_installed",
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_installed",
|
||||
return_value=True,
|
||||
),
|
||||
patch("builtins.input", return_value="1"),
|
||||
@ -151,7 +151,7 @@ class TestPickNextGame:
|
||||
patch("steam_backlog_enforcer.scanning._echo"),
|
||||
patch("steam_backlog_enforcer._scanning_confidence._echo"),
|
||||
patch(
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_fully_installed",
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_installed",
|
||||
return_value=False,
|
||||
),
|
||||
patch(
|
||||
@ -182,7 +182,7 @@ class TestAssignUninstallsAgainstTheAllowedSet:
|
||||
patch("steam_backlog_enforcer.scanning._echo"),
|
||||
patch("steam_backlog_enforcer._scanning_confidence._echo"),
|
||||
patch(
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_fully_installed",
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_installed",
|
||||
return_value=True,
|
||||
),
|
||||
patch(
|
||||
|
||||
@ -50,7 +50,7 @@ class TestPickNextGameSequential:
|
||||
)
|
||||
stack.enter_context(
|
||||
patch(
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_fully_installed",
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_installed",
|
||||
return_value=True,
|
||||
)
|
||||
)
|
||||
|
||||
@ -46,7 +46,7 @@ class TestPickNextGameGroup2:
|
||||
),
|
||||
patch("steam_backlog_enforcer.scanning._echo"),
|
||||
patch(
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_fully_installed",
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_installed",
|
||||
return_value=True,
|
||||
),
|
||||
patch(
|
||||
@ -70,7 +70,7 @@ class TestPickNextGameGroup2:
|
||||
),
|
||||
patch("steam_backlog_enforcer.scanning._echo"),
|
||||
patch(
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_fully_installed",
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_installed",
|
||||
return_value=True,
|
||||
),
|
||||
patch(
|
||||
@ -107,7 +107,7 @@ class TestPickNextGameGroup2:
|
||||
side_effect=lambda *a, **_: echoed.append(a[0]),
|
||||
),
|
||||
patch(
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_fully_installed",
|
||||
"steam_backlog_enforcer._scanning_assign.is_game_installed",
|
||||
return_value=True,
|
||||
),
|
||||
patch(
|
||||
|
||||
@ -73,9 +73,7 @@ class TestCmdStats:
|
||||
)
|
||||
echoed: list[str] = []
|
||||
with (
|
||||
patch(
|
||||
"steam_backlog_enforcer._snapshot.load_snapshot", return_value=snapshot
|
||||
),
|
||||
patch(f"{_PKG}.load_snapshot", return_value=snapshot),
|
||||
patch(
|
||||
f"{_PKG}._filter_qualifying_games",
|
||||
return_value=([entry], hltb_skip, linux_skip, no_data_skip),
|
||||
@ -94,12 +92,8 @@ class TestCmdStats:
|
||||
echoed: list[str] = []
|
||||
state = State()
|
||||
with (
|
||||
patch("steam_backlog_enforcer._snapshot.load_snapshot", return_value=None),
|
||||
# The "run scan" hint is printed by the shared snapshot helper.
|
||||
patch(
|
||||
"steam_backlog_enforcer._snapshot._echo",
|
||||
side_effect=lambda *a, **_: echoed.append(a[0]),
|
||||
),
|
||||
patch(f"{_PKG}.load_snapshot", return_value=None),
|
||||
patch(f"{_PKG}._echo", side_effect=lambda *a, **_: echoed.append(a[0])),
|
||||
):
|
||||
cmd_stats(self._config(), state)
|
||||
assert any("No snapshot found" in s for s in echoed)
|
||||
@ -159,9 +153,7 @@ class TestCmdStats:
|
||||
)
|
||||
echoed: list[str] = []
|
||||
with (
|
||||
patch(
|
||||
"steam_backlog_enforcer._snapshot.load_snapshot", return_value=snapshot
|
||||
),
|
||||
patch(f"{_PKG}.load_snapshot", return_value=snapshot),
|
||||
patch(
|
||||
f"{_PKG}._filter_qualifying_games",
|
||||
return_value=([entry], 0, 0, 0),
|
||||
@ -192,9 +184,7 @@ class TestCmdStats:
|
||||
)
|
||||
echoed: list[str] = []
|
||||
with (
|
||||
patch(
|
||||
"steam_backlog_enforcer._snapshot.load_snapshot", return_value=snapshot
|
||||
),
|
||||
patch(f"{_PKG}.load_snapshot", return_value=snapshot),
|
||||
patch(
|
||||
f"{_PKG}._filter_qualifying_games",
|
||||
return_value=([entry], 0, 0, 0),
|
||||
@ -216,9 +206,7 @@ class TestCmdStats:
|
||||
snapshot = [self._snapshot_game()]
|
||||
echoed: list[str] = []
|
||||
with (
|
||||
patch(
|
||||
"steam_backlog_enforcer._snapshot.load_snapshot", return_value=snapshot
|
||||
),
|
||||
patch(f"{_PKG}.load_snapshot", return_value=snapshot),
|
||||
patch(
|
||||
f"{_PKG}._filter_qualifying_games",
|
||||
return_value=([], 0, 0, 0),
|
||||
|
||||
@ -75,9 +75,7 @@ class TestCmdStatsGroup2:
|
||||
)
|
||||
echoed: list[str] = []
|
||||
with (
|
||||
patch(
|
||||
"steam_backlog_enforcer._snapshot.load_snapshot", return_value=snapshot
|
||||
),
|
||||
patch(f"{_PKG}.load_snapshot", return_value=snapshot),
|
||||
patch(
|
||||
f"{_PKG}._filter_qualifying_games",
|
||||
return_value=([entry], hltb_skip, linux_skip, no_data_skip),
|
||||
@ -109,9 +107,7 @@ class TestCmdStatsGroup2:
|
||||
return [entry], 0, 0, 0
|
||||
|
||||
with (
|
||||
patch(
|
||||
"steam_backlog_enforcer._snapshot.load_snapshot", return_value=snapshot
|
||||
),
|
||||
patch(f"{_PKG}.load_snapshot", return_value=snapshot),
|
||||
patch(f"{_PKG}._filter_qualifying_games", side_effect=count_filter),
|
||||
patch(f"{_PKG}._ensure_completed_rush_data", return_value=False),
|
||||
patch(f"{_PKG}._ensure_rush_data", return_value=True),
|
||||
@ -166,9 +162,7 @@ class TestCmdStatsGroup2:
|
||||
captured["games_done"] = games_done
|
||||
|
||||
with (
|
||||
patch(
|
||||
"steam_backlog_enforcer._snapshot.load_snapshot", return_value=snapshot
|
||||
),
|
||||
patch(f"{_PKG}.load_snapshot", return_value=snapshot),
|
||||
patch(
|
||||
f"{_PKG}._filter_qualifying_games",
|
||||
return_value=([entry], 0, 0, 0),
|
||||
@ -207,9 +201,7 @@ class TestCmdStatsGroup2:
|
||||
captured["leisure"] = leisure
|
||||
|
||||
with (
|
||||
patch(
|
||||
"steam_backlog_enforcer._snapshot.load_snapshot", return_value=snapshot
|
||||
),
|
||||
patch(f"{_PKG}.load_snapshot", return_value=snapshot),
|
||||
patch(
|
||||
f"{_PKG}._filter_qualifying_games",
|
||||
return_value=([entry], 0, 0, 0),
|
||||
|
||||
196
web/package-lock.json
generated
196
web/package-lock.json
generated
@ -26,10 +26,10 @@
|
||||
"eslint-plugin-react-hooks": "7.1.1",
|
||||
"eslint-plugin-react-refresh": "0.5.7",
|
||||
"globals": "17.12.0",
|
||||
"jsdom": "30.1.1",
|
||||
"jsdom": "30.1.0",
|
||||
"typescript": "6.0.3",
|
||||
"typescript-eslint": "8.70.0",
|
||||
"vite": "8.3.1",
|
||||
"vite": "8.3.0",
|
||||
"vitest": "5.0.1"
|
||||
}
|
||||
},
|
||||
@ -817,19 +817,19 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@oxc-project/types": {
|
||||
"version": "0.151.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.151.0.tgz",
|
||||
"integrity": "sha512-J1yXrIlNDZVzE3ada310xeAw7nH8yCAyLPuUIsjKatFPmfn5bS1oW+cM+QsGOtVWd5nhSpbwZWx/rue+r5Z+PA==",
|
||||
"version": "0.147.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.147.0.tgz",
|
||||
"integrity": "sha512-IJ3s6ltHLp45S0bh7phkX+gJO7A1Wuz2EaqpAhb8WjqDwbzMiWKHhyyT42tskaWjEYXtHtVCPpnBJVT9+dcRLg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/oxc-project"
|
||||
"url": "https://github.com/sponsors/Boshen"
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-android-arm-eabi": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.11.tgz",
|
||||
"integrity": "sha512-A5kXfGKvKWWZE0TtPrfsvT+q4Y5d1QG8gGUzpYjGydM+fARM9MuX90PrXYXe0XbsDVgyxxNzHo6giCj90bsFNw==",
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.6.tgz",
|
||||
"integrity": "sha512-b+jTcARdTiFLI6jB4a5XjTm0RWd6KcRfQj/I2356fxUZemiho9zQLxo0RtCuMDAyKcLo6cEltkgbQp6d1+sjjQ==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@ -844,9 +844,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-android-arm64": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.11.tgz",
|
||||
"integrity": "sha512-z6cTycz+iJ4PVkuL4HHW4DfTfoeU/2nqYYuSOrTmH7yHK5Y0LCOnA03V4ZNxavyVaU1oOqUgIg2klN/s+USGOA==",
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.6.tgz",
|
||||
"integrity": "sha512-lkWU8ZJaRk9q3CIEY1Tc7vIFALp3Xw5NfGJo2hQg5oIqNgxWi1zI+IiDEK3r70BF5Dzol1tcXsnzsRc8NLhG+Q==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@ -861,9 +861,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-darwin-arm64": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.11.tgz",
|
||||
"integrity": "sha512-jShvqNtP6vDC6/A5JOAzbVV+DkgHqhl/ScVCJEbt+TUY6QYz7YnXcrg3sLtFBniro0f/Ld50ZwCWA6f7KYD1nQ==",
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.6.tgz",
|
||||
"integrity": "sha512-dgR56NYnvAszm7Ob1B2/Vn0e8bUQYZH2UjVaMMtMVOCKFSfjhfLmuA/9+O+F+ajUdG6B/bSssrKW6JJYASa8jA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@ -878,9 +878,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-darwin-x64": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.11.tgz",
|
||||
"integrity": "sha512-f2i2xiNWq1Z1l2++q2fuhZRdLAT3aqxD6vRNm1RAxpUoBcdqNB3C0s1Bt+K+PbEx2F5F4gQp6hqKkphCY/xF9w==",
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.6.tgz",
|
||||
"integrity": "sha512-vpVxFvUCFioJqug7OTvqptkc4yb8UX0AwfDmJpaR/0sWz+BUmqSVAf7c8JkUgnN8YLspb4a/N6NhTyMAmdyQ7Q==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@ -895,9 +895,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-freebsd-x64": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.11.tgz",
|
||||
"integrity": "sha512-4Ir5FSOKIAMr4r0kExpt1s3bMgzJU3rA45AYOHtQpls0oNeqcYBKrWMlckrYH4KCfGLfkfn1tN1dmZPMVsdXow==",
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.6.tgz",
|
||||
"integrity": "sha512-h1wG6Y6K3JlRswxsI64qQJqBAy4vrLuHgRbc8CZMGSWTOFRY6ghMApM1NKzB2I0n5xV1fjkE18SuVl2QpLeNpA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@ -912,9 +912,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-arm-gnueabihf": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.11.tgz",
|
||||
"integrity": "sha512-/gnRDM+39BROzAN/k1OZjDPnDMcZxB/0EUxKjONO5yVkNEvlsoMDrxGNKgZi/ttFriS2gwlDNzB65pvNbFOXIQ==",
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.6.tgz",
|
||||
"integrity": "sha512-tbCiqub0q2MVWJKgF5PoAlNWCtQydiOYSLIkd8sByqK/6MMYLJRcSXSYodqYtd0O+Fw7QaVmKKlS4oL94YRZ0w==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@ -929,16 +929,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-arm64-gnu": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.11.tgz",
|
||||
"integrity": "sha512-PFaK8HwvAHbaKbBcDNQihjMKYvFnA5hiENx/l5tphTDz1E0WFp32l0A7aq7lyUwGsRw/xSrNIy/gIK4thrSCrw==",
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.6.tgz",
|
||||
"integrity": "sha512-oxK9+baEBPhZG5HB4URY+uU04zJWeZlH6Tb9rB5DK4DF9XR1uXNLXt5Q5ZsugTKayNCNLhkcwz/ye74hRI98dg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@ -949,16 +946,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-arm64-musl": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.11.tgz",
|
||||
"integrity": "sha512-AskzJUIKRLPxkruR1wLKewGbOw+EYfU/9lOrBFj4AFrEA8hPpKFnODWNu2WLaNs0QNkEb9QIJufmVZZIL/bJlg==",
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.6.tgz",
|
||||
"integrity": "sha512-muWCk27FVBEZtv0MsK8gnfSmgczA8KQ0uRVJbTABKhkRfQc38aUrcb7fhi3BNiyseFmgcRsoMfQsSNJ+DbZdSw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@ -969,16 +963,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-ppc64-gnu": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.11.tgz",
|
||||
"integrity": "sha512-qlUGAheh2yh8afH7QBgx0PrRHN85hKnNd78x8MeMhXivuevgd8vgf6/CstOzmNKY/lLTHvNTrPy98cLnAugzJw==",
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.6.tgz",
|
||||
"integrity": "sha512-eWDoSfU7Co2qj3vgB3Dt4lj1mG6CoWbcJQkRMP3XJplyCMtuaq3LHvPFjS9QIPvMGWVadJC04Xiy0IdcVPtnwQ==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@ -989,16 +980,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-s390x-gnu": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.11.tgz",
|
||||
"integrity": "sha512-secpEad+0vCbSfn8upFySkDskv+bGPk3THSDS9Y89yc4rb4kzqHp8Dmyd9BkQW4SnhNXBZCl/6CrO//hZahNJQ==",
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.6.tgz",
|
||||
"integrity": "sha512-2bWNjRSIayvupRKxXUY2tWG9fYdoUlTqWywHRvE8Eq3GvuQ+f2HeIkve697fIt+IQs/PV8yFsdWuhp1aJ1PdnA==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@ -1009,16 +997,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-x64-gnu": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.11.tgz",
|
||||
"integrity": "sha512-mOVBT3dPpkWm8XBWPmU4bf+U6dYDLeMo/9ojUmis4N0L5uu10qra5vOyngZ7/PSdoE4G9KvRt4bloRxNjLas7A==",
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.6.tgz",
|
||||
"integrity": "sha512-KekI0gS0wLxe1UBSQSjenBVwou/JkcQPDzBPICGZjxUv9k3RteHDPBQaiOicZUFKRIH2wKEimGwVpnJsbPzu7w==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@ -1029,16 +1014,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-x64-musl": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.11.tgz",
|
||||
"integrity": "sha512-Is78i9A8Ui4SqcxUwFJ9uMmjDn58IbVTjFWYdQestFEgeuEmHMLGNriXnVJKkwG2YiZjw8cP0zCTyDMdDGtOOg==",
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.6.tgz",
|
||||
"integrity": "sha512-TvtPnfVr+HtyGiDmPK4VWmlNm7QhNNAcK5Q9A7aOXsI8545yCyaoMaicXrFZ72JzeYjaUVk7yT243zT0jzjFKQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@ -1049,9 +1031,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-openharmony-arm64": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.11.tgz",
|
||||
"integrity": "sha512-dUCXneZ87INUMyQ0D+C0HrEBNUPNXHaPmU5GTjyKTJEiussw9Kaj5Ln8UztPe4epV/ffvgNBEadksdYhmW6xJA==",
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.6.tgz",
|
||||
"integrity": "sha512-iOo0VEay2XFhaCcH0sps5XIimkSuOnNaZrf6+ZkoSOQBJPKNU48RkmJv0/lSpipexu5P+ouFgafe5IGr/DiQfg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@ -1066,9 +1048,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-win32-arm64-msvc": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.11.tgz",
|
||||
"integrity": "sha512-jByxb6qfd+bH1xUd0qnfFnb17i9sWBPY2tOavJ0l3tdr3OTu+Kvtm8cd/JV5nFt657b1VqGltxg9olOEfofXWw==",
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.6.tgz",
|
||||
"integrity": "sha512-y5NTmmasMS455JlOCO4ZM9krIchv3Mvm1crL1iUPGOPgEzSkves9n0SdC5Sjz6+qWDFhd8/JpfWMH8NSWNHe+A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@ -1083,9 +1065,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-win32-x64-msvc": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.11.tgz",
|
||||
"integrity": "sha512-/PzKqzAJ03i19oy2ItPvyvaVjOjBCNnfaJs8yvUdGBKmiESgnrJSQ2awd81QzFbbnAmu7YO9ZnJrDCb9VSJPRA==",
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.6.tgz",
|
||||
"integrity": "sha512-np8iZSLfXlAD4kWhiyq/u0Yt8oZDtRQ8lGhQaCXo2rl37KNjeU0GjJuwr4P3oeZ++ROfofsKNBqR5LTO8aXyWQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@ -2422,16 +2404,16 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/html-encoding-sniffer": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-7.0.0.tgz",
|
||||
"integrity": "sha512-UikN5yr7xsCDAq87Or5or0PAlD3HJJOKVzM05az588WnpDJ4Ux7a2A53Qi6gofGg2/EtvF/H4hCi/TXfCW4Y6w==",
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-6.0.0.tgz",
|
||||
"integrity": "sha512-CV9TW3Y3f8/wT0BRFc1/KAVQ3TUHiXmaAb6VW9vtiMFf7SLoMd1PdAc4W3KFOFETBJUb90KatHqlsZMWV+R9Gg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@exodus/bytes": "^1.15.1"
|
||||
"@exodus/bytes": "^1.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^22.13.0 || >=24.0.0"
|
||||
"node": "^20.19.0 || ^22.12.0 || >=24.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ignore": {
|
||||
@ -2509,28 +2491,28 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/jsdom": {
|
||||
"version": "30.1.1",
|
||||
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-30.1.1.tgz",
|
||||
"integrity": "sha512-FahmoPK5vbPc+jxV1iErMHmAZypCZ942NHF4+qqaWAuvaKKTBZxawnmAtrbGWLU7MtlxfqIP0qw6aSI+aWGtLg==",
|
||||
"version": "30.1.0",
|
||||
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-30.1.0.tgz",
|
||||
"integrity": "sha512-h/Q+H+KmlGf49ITw3TrykSVbg04S75S2O7ZtJc9gMGOWBrQRZmx5AJIKLtJ01e6Kszl+/tpFthCVqxNifxhoqg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@asamuzakjp/css-color": "^7.0.0",
|
||||
"@asamuzakjp/dom-selector": "^9.2.1",
|
||||
"@asamuzakjp/dom-selector": "^9.1.2",
|
||||
"@bramus/specificity": "^2.4.2",
|
||||
"@csstools/css-syntax-patches-for-csstree": "^1.1.13",
|
||||
"@exodus/bytes": "^1.15.1",
|
||||
"css-tree": "^3.2.1",
|
||||
"data-urls": "^7.0.0",
|
||||
"decimal.js": "^10.6.0",
|
||||
"html-encoding-sniffer": "^7.0.0",
|
||||
"html-encoding-sniffer": "^6.0.0",
|
||||
"is-potential-custom-element-name": "^1.0.1",
|
||||
"lru-cache": "^11.5.2",
|
||||
"parse5": "^8.0.1",
|
||||
"saxes": "^6.0.0",
|
||||
"tough-cookie": "^6.0.2",
|
||||
"undici": "^8.10.2",
|
||||
"w3c-xmlserializer": "^6.0.0",
|
||||
"w3c-xmlserializer": "^5.0.0",
|
||||
"webidl-conversions": "^8.0.1",
|
||||
"whatwg-mimetype": "^5.0.0",
|
||||
"whatwg-url": "^17.1.1",
|
||||
@ -3286,13 +3268,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/rolldown": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.11.tgz",
|
||||
"integrity": "sha512-qpSwIyz0jHQq5qXBTNxFmE6664rJ7O+4TvPFOiOaBSrz8IOHc1koKKSqTM2H6u1UG1+TveuC6vaDHKXFOvb1Kw==",
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.6.tgz",
|
||||
"integrity": "sha512-vMM4q3aixf46GiF1Kok8jDPFsEpXgFWGjUHXNkNHNm+Y2adXAG2dbX91jkti3i0ZRsOlcmbuzAz1poObSHCmUA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@oxc-project/types": "=0.151.0",
|
||||
"@oxc-project/types": "=0.147.0",
|
||||
"@rolldown/pluginutils": "^1.0.0"
|
||||
},
|
||||
"bin": {
|
||||
@ -3302,21 +3284,21 @@
|
||||
"node": "^20.19.0 || >=22.12.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rolldown/binding-android-arm-eabi": "1.2.11",
|
||||
"@rolldown/binding-android-arm64": "1.2.11",
|
||||
"@rolldown/binding-darwin-arm64": "1.2.11",
|
||||
"@rolldown/binding-darwin-x64": "1.2.11",
|
||||
"@rolldown/binding-freebsd-x64": "1.2.11",
|
||||
"@rolldown/binding-linux-arm-gnueabihf": "1.2.11",
|
||||
"@rolldown/binding-linux-arm64-gnu": "1.2.11",
|
||||
"@rolldown/binding-linux-arm64-musl": "1.2.11",
|
||||
"@rolldown/binding-linux-ppc64-gnu": "1.2.11",
|
||||
"@rolldown/binding-linux-s390x-gnu": "1.2.11",
|
||||
"@rolldown/binding-linux-x64-gnu": "1.2.11",
|
||||
"@rolldown/binding-linux-x64-musl": "1.2.11",
|
||||
"@rolldown/binding-openharmony-arm64": "1.2.11",
|
||||
"@rolldown/binding-win32-arm64-msvc": "1.2.11",
|
||||
"@rolldown/binding-win32-x64-msvc": "1.2.11"
|
||||
"@rolldown/binding-android-arm-eabi": "1.2.6",
|
||||
"@rolldown/binding-android-arm64": "1.2.6",
|
||||
"@rolldown/binding-darwin-arm64": "1.2.6",
|
||||
"@rolldown/binding-darwin-x64": "1.2.6",
|
||||
"@rolldown/binding-freebsd-x64": "1.2.6",
|
||||
"@rolldown/binding-linux-arm-gnueabihf": "1.2.6",
|
||||
"@rolldown/binding-linux-arm64-gnu": "1.2.6",
|
||||
"@rolldown/binding-linux-arm64-musl": "1.2.6",
|
||||
"@rolldown/binding-linux-ppc64-gnu": "1.2.6",
|
||||
"@rolldown/binding-linux-s390x-gnu": "1.2.6",
|
||||
"@rolldown/binding-linux-x64-gnu": "1.2.6",
|
||||
"@rolldown/binding-linux-x64-musl": "1.2.6",
|
||||
"@rolldown/binding-openharmony-arm64": "1.2.6",
|
||||
"@rolldown/binding-win32-arm64-msvc": "1.2.6",
|
||||
"@rolldown/binding-win32-x64-msvc": "1.2.6"
|
||||
}
|
||||
},
|
||||
"node_modules/saxes": {
|
||||
@ -3631,16 +3613,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "8.3.1",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-8.3.1.tgz",
|
||||
"integrity": "sha512-/bvH9E9tmCXRGp2uXY3WbOldqpTwFkbha/8ANaEQ6VkxhH60KyqLwgZq6lG2y+4uT55x9+9eUHMpQ7uGnOCKjA==",
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-8.3.0.tgz",
|
||||
"integrity": "sha512-lhZBVvEHefgE+HQZC9O7EBJgCU/nVzFNl7vkS4RE0APtWLP02/8QVIkQtzBxPquh7lq5/78NHipTj7ODQ6XuyQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"lightningcss": "^1.33.0",
|
||||
"picomatch": "^4.0.7",
|
||||
"postcss": "^8.5.28",
|
||||
"rolldown": "~1.2.9",
|
||||
"rolldown": "~1.2.6",
|
||||
"tinyglobby": "^0.2.17"
|
||||
},
|
||||
"bin": {
|
||||
@ -3792,16 +3774,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/w3c-xmlserializer": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-6.0.0.tgz",
|
||||
"integrity": "sha512-4Nsy8K5Tr6SPDH9jhKJOHf7ChDrc1zufZTVSF7x72hwuEXBqxqk9G6cK+K2NRUtB3iELRJqjXb4JPDMBjMTl2Q==",
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz",
|
||||
"integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"xml-name-validator": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/webidl-conversions": {
|
||||
|
||||
@ -31,10 +31,10 @@
|
||||
"eslint-plugin-react-hooks": "7.1.1",
|
||||
"eslint-plugin-react-refresh": "0.5.7",
|
||||
"globals": "17.12.0",
|
||||
"jsdom": "30.1.1",
|
||||
"jsdom": "30.1.0",
|
||||
"typescript": "6.0.3",
|
||||
"typescript-eslint": "8.70.0",
|
||||
"vite": "8.3.1",
|
||||
"vite": "8.3.0",
|
||||
"vitest": "5.0.1"
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ importers:
|
||||
version: 19.3.0(@types/react@19.3.0)
|
||||
'@vitejs/plugin-react':
|
||||
specifier: 6.1.1
|
||||
version: 6.1.1(vite@8.3.1(@types/node@26.6.2))
|
||||
version: 6.1.1(vite@8.3.0(@types/node@26.6.2))
|
||||
'@vitest/coverage-v8':
|
||||
specifier: 5.0.1
|
||||
version: 5.0.1(vitest@5.0.1)
|
||||
@ -58,8 +58,8 @@ importers:
|
||||
specifier: 17.12.0
|
||||
version: 17.12.0
|
||||
jsdom:
|
||||
specifier: 30.1.1
|
||||
version: 30.1.1
|
||||
specifier: 30.1.0
|
||||
version: 30.1.0
|
||||
typescript:
|
||||
specifier: 6.0.3
|
||||
version: 6.0.3
|
||||
@ -67,11 +67,11 @@ importers:
|
||||
specifier: 8.70.0
|
||||
version: 8.70.0(eslint@10.11.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3)
|
||||
vite:
|
||||
specifier: 8.3.1
|
||||
version: 8.3.1(@types/node@26.6.2)
|
||||
specifier: 8.3.0
|
||||
version: 8.3.0(@types/node@26.6.2)
|
||||
vitest:
|
||||
specifier: 5.0.1
|
||||
version: 5.0.1(@types/node@26.6.2)(@vitest/coverage-v8@5.0.1)(jsdom@30.1.1)(vite@8.3.1(@types/node@26.6.2))
|
||||
version: 5.0.1(@types/node@26.6.2)(@vitest/coverage-v8@5.0.1)(jsdom@30.1.0)(vite@8.3.0(@types/node@26.6.2))
|
||||
|
||||
packages:
|
||||
|
||||
@ -82,8 +82,8 @@ packages:
|
||||
resolution: {integrity: sha512-IxddtGnnoidVSO6O/aiTueptbTThHvi2qGHu9/AWuD1J7i86Ox+jl+Y5SXcDH1RixzQlP2cjH/PjnlImZiAurQ==}
|
||||
engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0}
|
||||
|
||||
'@asamuzakjp/dom-selector@9.2.1':
|
||||
resolution: {integrity: sha512-NT4s3yZLjovPpliRpTvdsdzyPjqRqiCZj9MxnarBihbaY5MbAG7DWAJcrLlhmC7xKTNCXsTELcqB8YsqpLnUFQ==}
|
||||
'@asamuzakjp/dom-selector@9.2.0':
|
||||
resolution: {integrity: sha512-qKvLetaSd/OTWif9JT0eu1SHBg3H7Nvp9SoMwMxqT5tmYyrxea/P1A5pIfGbnIJlOtm3yVeqw+ORxDOkjN1aEw==}
|
||||
engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0}
|
||||
|
||||
'@babel/code-frame@7.29.7':
|
||||
@ -300,101 +300,101 @@ packages:
|
||||
'@keyv/serialize@1.1.1':
|
||||
resolution: {integrity: sha512-dXn3FZhPv0US+7dtJsIi2R+c7qWYiReoEh5zUntWCf4oSpMNib8FDhSoed6m3QyZdx5hK7iLFkYk3rNxwt8vTA==}
|
||||
|
||||
'@oxc-project/types@0.151.0':
|
||||
resolution: {integrity: sha512-J1yXrIlNDZVzE3ada310xeAw7nH8yCAyLPuUIsjKatFPmfn5bS1oW+cM+QsGOtVWd5nhSpbwZWx/rue+r5Z+PA==}
|
||||
'@oxc-project/types@0.147.0':
|
||||
resolution: {integrity: sha512-IJ3s6ltHLp45S0bh7phkX+gJO7A1Wuz2EaqpAhb8WjqDwbzMiWKHhyyT42tskaWjEYXtHtVCPpnBJVT9+dcRLg==}
|
||||
|
||||
'@rolldown/binding-android-arm-eabi@1.2.11':
|
||||
resolution: {integrity: sha512-A5kXfGKvKWWZE0TtPrfsvT+q4Y5d1QG8gGUzpYjGydM+fARM9MuX90PrXYXe0XbsDVgyxxNzHo6giCj90bsFNw==}
|
||||
'@rolldown/binding-android-arm-eabi@1.2.6':
|
||||
resolution: {integrity: sha512-b+jTcARdTiFLI6jB4a5XjTm0RWd6KcRfQj/I2356fxUZemiho9zQLxo0RtCuMDAyKcLo6cEltkgbQp6d1+sjjQ==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm]
|
||||
os: [android]
|
||||
|
||||
'@rolldown/binding-android-arm64@1.2.11':
|
||||
resolution: {integrity: sha512-z6cTycz+iJ4PVkuL4HHW4DfTfoeU/2nqYYuSOrTmH7yHK5Y0LCOnA03V4ZNxavyVaU1oOqUgIg2klN/s+USGOA==}
|
||||
'@rolldown/binding-android-arm64@1.2.6':
|
||||
resolution: {integrity: sha512-lkWU8ZJaRk9q3CIEY1Tc7vIFALp3Xw5NfGJo2hQg5oIqNgxWi1zI+IiDEK3r70BF5Dzol1tcXsnzsRc8NLhG+Q==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [android]
|
||||
|
||||
'@rolldown/binding-darwin-arm64@1.2.11':
|
||||
resolution: {integrity: sha512-jShvqNtP6vDC6/A5JOAzbVV+DkgHqhl/ScVCJEbt+TUY6QYz7YnXcrg3sLtFBniro0f/Ld50ZwCWA6f7KYD1nQ==}
|
||||
'@rolldown/binding-darwin-arm64@1.2.6':
|
||||
resolution: {integrity: sha512-dgR56NYnvAszm7Ob1B2/Vn0e8bUQYZH2UjVaMMtMVOCKFSfjhfLmuA/9+O+F+ajUdG6B/bSssrKW6JJYASa8jA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
|
||||
'@rolldown/binding-darwin-x64@1.2.11':
|
||||
resolution: {integrity: sha512-f2i2xiNWq1Z1l2++q2fuhZRdLAT3aqxD6vRNm1RAxpUoBcdqNB3C0s1Bt+K+PbEx2F5F4gQp6hqKkphCY/xF9w==}
|
||||
'@rolldown/binding-darwin-x64@1.2.6':
|
||||
resolution: {integrity: sha512-vpVxFvUCFioJqug7OTvqptkc4yb8UX0AwfDmJpaR/0sWz+BUmqSVAf7c8JkUgnN8YLspb4a/N6NhTyMAmdyQ7Q==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
|
||||
'@rolldown/binding-freebsd-x64@1.2.11':
|
||||
resolution: {integrity: sha512-4Ir5FSOKIAMr4r0kExpt1s3bMgzJU3rA45AYOHtQpls0oNeqcYBKrWMlckrYH4KCfGLfkfn1tN1dmZPMVsdXow==}
|
||||
'@rolldown/binding-freebsd-x64@1.2.6':
|
||||
resolution: {integrity: sha512-h1wG6Y6K3JlRswxsI64qQJqBAy4vrLuHgRbc8CZMGSWTOFRY6ghMApM1NKzB2I0n5xV1fjkE18SuVl2QpLeNpA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [freebsd]
|
||||
|
||||
'@rolldown/binding-linux-arm-gnueabihf@1.2.11':
|
||||
resolution: {integrity: sha512-/gnRDM+39BROzAN/k1OZjDPnDMcZxB/0EUxKjONO5yVkNEvlsoMDrxGNKgZi/ttFriS2gwlDNzB65pvNbFOXIQ==}
|
||||
'@rolldown/binding-linux-arm-gnueabihf@1.2.6':
|
||||
resolution: {integrity: sha512-tbCiqub0q2MVWJKgF5PoAlNWCtQydiOYSLIkd8sByqK/6MMYLJRcSXSYodqYtd0O+Fw7QaVmKKlS4oL94YRZ0w==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
|
||||
'@rolldown/binding-linux-arm64-gnu@1.2.11':
|
||||
resolution: {integrity: sha512-PFaK8HwvAHbaKbBcDNQihjMKYvFnA5hiENx/l5tphTDz1E0WFp32l0A7aq7lyUwGsRw/xSrNIy/gIK4thrSCrw==}
|
||||
'@rolldown/binding-linux-arm64-gnu@1.2.6':
|
||||
resolution: {integrity: sha512-oxK9+baEBPhZG5HB4URY+uU04zJWeZlH6Tb9rB5DK4DF9XR1uXNLXt5Q5ZsugTKayNCNLhkcwz/ye74hRI98dg==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rolldown/binding-linux-arm64-musl@1.2.11':
|
||||
resolution: {integrity: sha512-AskzJUIKRLPxkruR1wLKewGbOw+EYfU/9lOrBFj4AFrEA8hPpKFnODWNu2WLaNs0QNkEb9QIJufmVZZIL/bJlg==}
|
||||
'@rolldown/binding-linux-arm64-musl@1.2.6':
|
||||
resolution: {integrity: sha512-muWCk27FVBEZtv0MsK8gnfSmgczA8KQ0uRVJbTABKhkRfQc38aUrcb7fhi3BNiyseFmgcRsoMfQsSNJ+DbZdSw==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rolldown/binding-linux-ppc64-gnu@1.2.11':
|
||||
resolution: {integrity: sha512-qlUGAheh2yh8afH7QBgx0PrRHN85hKnNd78x8MeMhXivuevgd8vgf6/CstOzmNKY/lLTHvNTrPy98cLnAugzJw==}
|
||||
'@rolldown/binding-linux-ppc64-gnu@1.2.6':
|
||||
resolution: {integrity: sha512-eWDoSfU7Co2qj3vgB3Dt4lj1mG6CoWbcJQkRMP3XJplyCMtuaq3LHvPFjS9QIPvMGWVadJC04Xiy0IdcVPtnwQ==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rolldown/binding-linux-s390x-gnu@1.2.11':
|
||||
resolution: {integrity: sha512-secpEad+0vCbSfn8upFySkDskv+bGPk3THSDS9Y89yc4rb4kzqHp8Dmyd9BkQW4SnhNXBZCl/6CrO//hZahNJQ==}
|
||||
'@rolldown/binding-linux-s390x-gnu@1.2.6':
|
||||
resolution: {integrity: sha512-2bWNjRSIayvupRKxXUY2tWG9fYdoUlTqWywHRvE8Eq3GvuQ+f2HeIkve697fIt+IQs/PV8yFsdWuhp1aJ1PdnA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rolldown/binding-linux-x64-gnu@1.2.11':
|
||||
resolution: {integrity: sha512-mOVBT3dPpkWm8XBWPmU4bf+U6dYDLeMo/9ojUmis4N0L5uu10qra5vOyngZ7/PSdoE4G9KvRt4bloRxNjLas7A==}
|
||||
'@rolldown/binding-linux-x64-gnu@1.2.6':
|
||||
resolution: {integrity: sha512-KekI0gS0wLxe1UBSQSjenBVwou/JkcQPDzBPICGZjxUv9k3RteHDPBQaiOicZUFKRIH2wKEimGwVpnJsbPzu7w==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rolldown/binding-linux-x64-musl@1.2.11':
|
||||
resolution: {integrity: sha512-Is78i9A8Ui4SqcxUwFJ9uMmjDn58IbVTjFWYdQestFEgeuEmHMLGNriXnVJKkwG2YiZjw8cP0zCTyDMdDGtOOg==}
|
||||
'@rolldown/binding-linux-x64-musl@1.2.6':
|
||||
resolution: {integrity: sha512-TvtPnfVr+HtyGiDmPK4VWmlNm7QhNNAcK5Q9A7aOXsI8545yCyaoMaicXrFZ72JzeYjaUVk7yT243zT0jzjFKQ==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rolldown/binding-openharmony-arm64@1.2.11':
|
||||
resolution: {integrity: sha512-dUCXneZ87INUMyQ0D+C0HrEBNUPNXHaPmU5GTjyKTJEiussw9Kaj5Ln8UztPe4epV/ffvgNBEadksdYhmW6xJA==}
|
||||
'@rolldown/binding-openharmony-arm64@1.2.6':
|
||||
resolution: {integrity: sha512-iOo0VEay2XFhaCcH0sps5XIimkSuOnNaZrf6+ZkoSOQBJPKNU48RkmJv0/lSpipexu5P+ouFgafe5IGr/DiQfg==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [openharmony]
|
||||
|
||||
'@rolldown/binding-win32-arm64-msvc@1.2.11':
|
||||
resolution: {integrity: sha512-jByxb6qfd+bH1xUd0qnfFnb17i9sWBPY2tOavJ0l3tdr3OTu+Kvtm8cd/JV5nFt657b1VqGltxg9olOEfofXWw==}
|
||||
'@rolldown/binding-win32-arm64-msvc@1.2.6':
|
||||
resolution: {integrity: sha512-y5NTmmasMS455JlOCO4ZM9krIchv3Mvm1crL1iUPGOPgEzSkves9n0SdC5Sjz6+qWDFhd8/JpfWMH8NSWNHe+A==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
|
||||
'@rolldown/binding-win32-x64-msvc@1.2.11':
|
||||
resolution: {integrity: sha512-/PzKqzAJ03i19oy2ItPvyvaVjOjBCNnfaJs8yvUdGBKmiESgnrJSQ2awd81QzFbbnAmu7YO9ZnJrDCb9VSJPRA==}
|
||||
'@rolldown/binding-win32-x64-msvc@1.2.6':
|
||||
resolution: {integrity: sha512-np8iZSLfXlAD4kWhiyq/u0Yt8oZDtRQ8lGhQaCXo2rl37KNjeU0GjJuwr4P3oeZ++ROfofsKNBqR5LTO8aXyWQ==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
@ -834,9 +834,9 @@ packages:
|
||||
hookified@2.2.0:
|
||||
resolution: {integrity: sha512-p/LgFzRN5FeoD3DLS6bkUapeye6E4SI6yJs6KetENd18S+FBthqYq2amJUWpt5z0EQwwHemidjY5OqJGEKm5uA==}
|
||||
|
||||
html-encoding-sniffer@7.0.0:
|
||||
resolution: {integrity: sha512-UikN5yr7xsCDAq87Or5or0PAlD3HJJOKVzM05az588WnpDJ4Ux7a2A53Qi6gofGg2/EtvF/H4hCi/TXfCW4Y6w==}
|
||||
engines: {node: ^22.13.0 || >=24.0.0}
|
||||
html-encoding-sniffer@6.0.0:
|
||||
resolution: {integrity: sha512-CV9TW3Y3f8/wT0BRFc1/KAVQ3TUHiXmaAb6VW9vtiMFf7SLoMd1PdAc4W3KFOFETBJUb90KatHqlsZMWV+R9Gg==}
|
||||
engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0}
|
||||
|
||||
ignore@5.3.2:
|
||||
resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==}
|
||||
@ -874,8 +874,8 @@ packages:
|
||||
js-tokens@4.0.0:
|
||||
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
|
||||
|
||||
jsdom@30.1.1:
|
||||
resolution: {integrity: sha512-FahmoPK5vbPc+jxV1iErMHmAZypCZ942NHF4+qqaWAuvaKKTBZxawnmAtrbGWLU7MtlxfqIP0qw6aSI+aWGtLg==}
|
||||
jsdom@30.1.0:
|
||||
resolution: {integrity: sha512-h/Q+H+KmlGf49ITw3TrykSVbg04S75S2O7ZtJc9gMGOWBrQRZmx5AJIKLtJ01e6Kszl+/tpFthCVqxNifxhoqg==}
|
||||
engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0}
|
||||
peerDependencies:
|
||||
canvas: ^3.2.3
|
||||
@ -988,10 +988,6 @@ packages:
|
||||
resolution: {integrity: sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==}
|
||||
engines: {node: 20 || >=22}
|
||||
|
||||
lru-cache@11.5.3:
|
||||
resolution: {integrity: sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==}
|
||||
engines: {node: 20 || >=22}
|
||||
|
||||
lru-cache@5.1.1:
|
||||
resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==}
|
||||
|
||||
@ -1105,8 +1101,8 @@ packages:
|
||||
resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
rolldown@1.2.11:
|
||||
resolution: {integrity: sha512-qpSwIyz0jHQq5qXBTNxFmE6664rJ7O+4TvPFOiOaBSrz8IOHc1koKKSqTM2H6u1UG1+TveuC6vaDHKXFOvb1Kw==}
|
||||
rolldown@1.2.6:
|
||||
resolution: {integrity: sha512-vMM4q3aixf46GiF1Kok8jDPFsEpXgFWGjUHXNkNHNm+Y2adXAG2dbX91jkti3i0ZRsOlcmbuzAz1poObSHCmUA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
hasBin: true
|
||||
|
||||
@ -1224,8 +1220,8 @@ packages:
|
||||
uri-js@4.4.1:
|
||||
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
|
||||
|
||||
vite@8.3.1:
|
||||
resolution: {integrity: sha512-/bvH9E9tmCXRGp2uXY3WbOldqpTwFkbha/8ANaEQ6VkxhH60KyqLwgZq6lG2y+4uT55x9+9eUHMpQ7uGnOCKjA==}
|
||||
vite@8.3.0:
|
||||
resolution: {integrity: sha512-lhZBVvEHefgE+HQZC9O7EBJgCU/nVzFNl7vkS4RE0APtWLP02/8QVIkQtzBxPquh7lq5/78NHipTj7ODQ6XuyQ==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
@ -1308,9 +1304,9 @@ packages:
|
||||
jsdom:
|
||||
optional: true
|
||||
|
||||
w3c-xmlserializer@6.0.0:
|
||||
resolution: {integrity: sha512-4Nsy8K5Tr6SPDH9jhKJOHf7ChDrc1zufZTVSF7x72hwuEXBqxqk9G6cK+K2NRUtB3iELRJqjXb4JPDMBjMTl2Q==}
|
||||
engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0}
|
||||
w3c-xmlserializer@5.0.0:
|
||||
resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
webidl-conversions@8.0.1:
|
||||
resolution: {integrity: sha512-BMhLD/Sw+GbJC21C/UgyaZX41nPt8bUTg+jWyDeg7e7YN4xOM05YPSIXceACnXVtqyEw/LMClUQMtMZ+PGGpqQ==}
|
||||
@ -1377,12 +1373,12 @@ snapshots:
|
||||
'@csstools/css-tokenizer': 4.0.0
|
||||
lru-cache: 11.5.2
|
||||
|
||||
'@asamuzakjp/dom-selector@9.2.1':
|
||||
'@asamuzakjp/dom-selector@9.2.0':
|
||||
dependencies:
|
||||
bidi-js: 1.1.0
|
||||
css-tree: 3.2.1
|
||||
is-potential-custom-element-name: 1.0.1
|
||||
lru-cache: 11.5.3
|
||||
lru-cache: 11.5.2
|
||||
|
||||
'@babel/code-frame@7.29.7':
|
||||
dependencies:
|
||||
@ -1607,51 +1603,51 @@ snapshots:
|
||||
|
||||
'@keyv/serialize@1.1.1': {}
|
||||
|
||||
'@oxc-project/types@0.151.0': {}
|
||||
'@oxc-project/types@0.147.0': {}
|
||||
|
||||
'@rolldown/binding-android-arm-eabi@1.2.11':
|
||||
'@rolldown/binding-android-arm-eabi@1.2.6':
|
||||
optional: true
|
||||
|
||||
'@rolldown/binding-android-arm64@1.2.11':
|
||||
'@rolldown/binding-android-arm64@1.2.6':
|
||||
optional: true
|
||||
|
||||
'@rolldown/binding-darwin-arm64@1.2.11':
|
||||
'@rolldown/binding-darwin-arm64@1.2.6':
|
||||
optional: true
|
||||
|
||||
'@rolldown/binding-darwin-x64@1.2.11':
|
||||
'@rolldown/binding-darwin-x64@1.2.6':
|
||||
optional: true
|
||||
|
||||
'@rolldown/binding-freebsd-x64@1.2.11':
|
||||
'@rolldown/binding-freebsd-x64@1.2.6':
|
||||
optional: true
|
||||
|
||||
'@rolldown/binding-linux-arm-gnueabihf@1.2.11':
|
||||
'@rolldown/binding-linux-arm-gnueabihf@1.2.6':
|
||||
optional: true
|
||||
|
||||
'@rolldown/binding-linux-arm64-gnu@1.2.11':
|
||||
'@rolldown/binding-linux-arm64-gnu@1.2.6':
|
||||
optional: true
|
||||
|
||||
'@rolldown/binding-linux-arm64-musl@1.2.11':
|
||||
'@rolldown/binding-linux-arm64-musl@1.2.6':
|
||||
optional: true
|
||||
|
||||
'@rolldown/binding-linux-ppc64-gnu@1.2.11':
|
||||
'@rolldown/binding-linux-ppc64-gnu@1.2.6':
|
||||
optional: true
|
||||
|
||||
'@rolldown/binding-linux-s390x-gnu@1.2.11':
|
||||
'@rolldown/binding-linux-s390x-gnu@1.2.6':
|
||||
optional: true
|
||||
|
||||
'@rolldown/binding-linux-x64-gnu@1.2.11':
|
||||
'@rolldown/binding-linux-x64-gnu@1.2.6':
|
||||
optional: true
|
||||
|
||||
'@rolldown/binding-linux-x64-musl@1.2.11':
|
||||
'@rolldown/binding-linux-x64-musl@1.2.6':
|
||||
optional: true
|
||||
|
||||
'@rolldown/binding-openharmony-arm64@1.2.11':
|
||||
'@rolldown/binding-openharmony-arm64@1.2.6':
|
||||
optional: true
|
||||
|
||||
'@rolldown/binding-win32-arm64-msvc@1.2.11':
|
||||
'@rolldown/binding-win32-arm64-msvc@1.2.6':
|
||||
optional: true
|
||||
|
||||
'@rolldown/binding-win32-x64-msvc@1.2.11':
|
||||
'@rolldown/binding-win32-x64-msvc@1.2.6':
|
||||
optional: true
|
||||
|
||||
'@rolldown/pluginutils@1.0.1': {}
|
||||
@ -1677,7 +1673,7 @@ snapshots:
|
||||
picocolors: 1.1.1
|
||||
redent: 3.0.0
|
||||
optionalDependencies:
|
||||
vitest: 5.0.1(@types/node@26.6.2)(@vitest/coverage-v8@5.0.1)(jsdom@30.1.1)(vite@8.3.1(@types/node@26.6.2))
|
||||
vitest: 5.0.1(@types/node@26.6.2)(@vitest/coverage-v8@5.0.1)(jsdom@30.1.0)(vite@8.3.0(@types/node@26.6.2))
|
||||
|
||||
'@testing-library/react@16.3.3(@testing-library/dom@10.4.2)(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)':
|
||||
dependencies:
|
||||
@ -1811,10 +1807,10 @@ snapshots:
|
||||
'@typescript-eslint/types': 8.70.0
|
||||
eslint-visitor-keys: 5.0.1
|
||||
|
||||
'@vitejs/plugin-react@6.1.1(vite@8.3.1(@types/node@26.6.2))':
|
||||
'@vitejs/plugin-react@6.1.1(vite@8.3.0(@types/node@26.6.2))':
|
||||
dependencies:
|
||||
'@rolldown/pluginutils': 1.0.1
|
||||
vite: 8.3.1(@types/node@26.6.2)
|
||||
vite: 8.3.0(@types/node@26.6.2)
|
||||
|
||||
'@vitest/coverage-v8@5.0.1(vitest@5.0.1)':
|
||||
dependencies:
|
||||
@ -1826,7 +1822,7 @@ snapshots:
|
||||
obug: 2.1.4
|
||||
std-env: 4.2.0
|
||||
tinyrainbow: 3.1.1
|
||||
vitest: 5.0.1(@types/node@26.6.2)(@vitest/coverage-v8@5.0.1)(jsdom@30.1.1)(vite@8.3.1(@types/node@26.6.2))
|
||||
vitest: 5.0.1(@types/node@26.6.2)(@vitest/coverage-v8@5.0.1)(jsdom@30.1.0)(vite@8.3.0(@types/node@26.6.2))
|
||||
|
||||
'@vitest/istanbul-lib-coverage@1.0.1': {}
|
||||
|
||||
@ -1834,14 +1830,14 @@ snapshots:
|
||||
dependencies:
|
||||
'@vitest/istanbul-lib-coverage': 1.0.1
|
||||
|
||||
'@vitest/mocker@5.0.1(vite@8.3.1(@types/node@26.6.2))':
|
||||
'@vitest/mocker@5.0.1(vite@8.3.0(@types/node@26.6.2))':
|
||||
dependencies:
|
||||
'@jridgewell/trace-mapping': 0.3.31
|
||||
'@vitest/spy': 5.0.1
|
||||
estree-walker: 3.0.3
|
||||
magic-string: 1.3.1
|
||||
optionalDependencies:
|
||||
vite: 8.3.1(@types/node@26.6.2)
|
||||
vite: 8.3.0(@types/node@26.6.2)
|
||||
|
||||
'@vitest/spy@5.0.1': {}
|
||||
|
||||
@ -2100,7 +2096,7 @@ snapshots:
|
||||
|
||||
hookified@2.2.0: {}
|
||||
|
||||
html-encoding-sniffer@7.0.0:
|
||||
html-encoding-sniffer@6.0.0:
|
||||
dependencies:
|
||||
'@exodus/bytes': 1.15.1
|
||||
transitivePeerDependencies:
|
||||
@ -2128,24 +2124,24 @@ snapshots:
|
||||
|
||||
js-tokens@4.0.0: {}
|
||||
|
||||
jsdom@30.1.1:
|
||||
jsdom@30.1.0:
|
||||
dependencies:
|
||||
'@asamuzakjp/css-color': 7.0.0
|
||||
'@asamuzakjp/dom-selector': 9.2.1
|
||||
'@asamuzakjp/dom-selector': 9.2.0
|
||||
'@bramus/specificity': 2.4.2
|
||||
'@csstools/css-syntax-patches-for-csstree': 1.1.14(css-tree@3.2.1)
|
||||
'@exodus/bytes': 1.15.1
|
||||
css-tree: 3.2.1
|
||||
data-urls: 7.0.0
|
||||
decimal.js: 10.6.0
|
||||
html-encoding-sniffer: 7.0.0
|
||||
html-encoding-sniffer: 6.0.0
|
||||
is-potential-custom-element-name: 1.0.1
|
||||
lru-cache: 11.5.2
|
||||
parse5: 8.0.1
|
||||
saxes: 6.0.0
|
||||
tough-cookie: 6.0.2
|
||||
undici: 8.10.2
|
||||
w3c-xmlserializer: 6.0.0
|
||||
w3c-xmlserializer: 5.0.0
|
||||
webidl-conversions: 8.0.1
|
||||
whatwg-mimetype: 5.0.0
|
||||
whatwg-url: 17.1.1
|
||||
@ -2225,8 +2221,6 @@ snapshots:
|
||||
|
||||
lru-cache@11.5.2: {}
|
||||
|
||||
lru-cache@11.5.3: {}
|
||||
|
||||
lru-cache@5.1.1:
|
||||
dependencies:
|
||||
yallist: 3.1.1
|
||||
@ -2326,26 +2320,26 @@ snapshots:
|
||||
|
||||
require-from-string@2.0.2: {}
|
||||
|
||||
rolldown@1.2.11:
|
||||
rolldown@1.2.6:
|
||||
dependencies:
|
||||
'@oxc-project/types': 0.151.0
|
||||
'@oxc-project/types': 0.147.0
|
||||
'@rolldown/pluginutils': 1.0.1
|
||||
optionalDependencies:
|
||||
'@rolldown/binding-android-arm-eabi': 1.2.11
|
||||
'@rolldown/binding-android-arm64': 1.2.11
|
||||
'@rolldown/binding-darwin-arm64': 1.2.11
|
||||
'@rolldown/binding-darwin-x64': 1.2.11
|
||||
'@rolldown/binding-freebsd-x64': 1.2.11
|
||||
'@rolldown/binding-linux-arm-gnueabihf': 1.2.11
|
||||
'@rolldown/binding-linux-arm64-gnu': 1.2.11
|
||||
'@rolldown/binding-linux-arm64-musl': 1.2.11
|
||||
'@rolldown/binding-linux-ppc64-gnu': 1.2.11
|
||||
'@rolldown/binding-linux-s390x-gnu': 1.2.11
|
||||
'@rolldown/binding-linux-x64-gnu': 1.2.11
|
||||
'@rolldown/binding-linux-x64-musl': 1.2.11
|
||||
'@rolldown/binding-openharmony-arm64': 1.2.11
|
||||
'@rolldown/binding-win32-arm64-msvc': 1.2.11
|
||||
'@rolldown/binding-win32-x64-msvc': 1.2.11
|
||||
'@rolldown/binding-android-arm-eabi': 1.2.6
|
||||
'@rolldown/binding-android-arm64': 1.2.6
|
||||
'@rolldown/binding-darwin-arm64': 1.2.6
|
||||
'@rolldown/binding-darwin-x64': 1.2.6
|
||||
'@rolldown/binding-freebsd-x64': 1.2.6
|
||||
'@rolldown/binding-linux-arm-gnueabihf': 1.2.6
|
||||
'@rolldown/binding-linux-arm64-gnu': 1.2.6
|
||||
'@rolldown/binding-linux-arm64-musl': 1.2.6
|
||||
'@rolldown/binding-linux-ppc64-gnu': 1.2.6
|
||||
'@rolldown/binding-linux-s390x-gnu': 1.2.6
|
||||
'@rolldown/binding-linux-x64-gnu': 1.2.6
|
||||
'@rolldown/binding-linux-x64-musl': 1.2.6
|
||||
'@rolldown/binding-openharmony-arm64': 1.2.6
|
||||
'@rolldown/binding-win32-arm64-msvc': 1.2.6
|
||||
'@rolldown/binding-win32-x64-msvc': 1.2.6
|
||||
|
||||
saxes@6.0.0:
|
||||
dependencies:
|
||||
@ -2440,21 +2434,21 @@ snapshots:
|
||||
dependencies:
|
||||
punycode: 2.3.1
|
||||
|
||||
vite@8.3.1(@types/node@26.6.2):
|
||||
vite@8.3.0(@types/node@26.6.2):
|
||||
dependencies:
|
||||
lightningcss: 1.33.0
|
||||
picomatch: 4.0.7
|
||||
postcss: 8.5.28
|
||||
rolldown: 1.2.11
|
||||
rolldown: 1.2.6
|
||||
tinyglobby: 0.2.17
|
||||
optionalDependencies:
|
||||
'@types/node': 26.6.2
|
||||
fsevents: 2.3.3
|
||||
|
||||
vitest@5.0.1(@types/node@26.6.2)(@vitest/coverage-v8@5.0.1)(jsdom@30.1.1)(vite@8.3.1(@types/node@26.6.2)):
|
||||
vitest@5.0.1(@types/node@26.6.2)(@vitest/coverage-v8@5.0.1)(jsdom@30.1.0)(vite@8.3.0(@types/node@26.6.2)):
|
||||
dependencies:
|
||||
'@types/chai': 5.2.3
|
||||
'@vitest/mocker': 5.0.1(vite@8.3.1(@types/node@26.6.2))
|
||||
'@vitest/mocker': 5.0.1(vite@8.3.0(@types/node@26.6.2))
|
||||
chai: 6.2.2
|
||||
es-module-lexer: 2.3.2
|
||||
expect-type: 1.4.0
|
||||
@ -2465,16 +2459,16 @@ snapshots:
|
||||
tinybench: 6.1.4
|
||||
tinyexec: 1.3.0
|
||||
tinyglobby: 0.2.17
|
||||
vite: 8.3.1(@types/node@26.6.2)
|
||||
vite: 8.3.0(@types/node@26.6.2)
|
||||
why-is-node-running: 2.3.0
|
||||
optionalDependencies:
|
||||
'@types/node': 26.6.2
|
||||
'@vitest/coverage-v8': 5.0.1(vitest@5.0.1)
|
||||
jsdom: 30.1.1
|
||||
jsdom: 30.1.0
|
||||
transitivePeerDependencies:
|
||||
- msw
|
||||
|
||||
w3c-xmlserializer@6.0.0:
|
||||
w3c-xmlserializer@5.0.0:
|
||||
dependencies:
|
||||
xml-name-validator: 5.0.0
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user