fix: sync test paths, drop stale assertions, fix coverage gap

- linux_configuration/tests: update script paths after periodic_background/
  reorganisation (hosts_file_monitor, makepkg_capped, music_parallelism,
  shutdown_timer_monitor, usage_monitoring_installer_efficiency)

- test_i3blocks_efficiency.sh: remove checks for HEARTBEAT_INTERVAL_S and
  WARP_POLL_INTERVAL_S constants that no longer exist

- test_pacman_wrapper_security.sh: remove tests 20-21 (builtin time helpers /
  external date calls) that are no longer applicable; update path

- generate_hosts_file.sh: add sed unblock rules for delio.com.pl and
  loverslab.com to stay consistent with install.sh whitelist

- steam_backlog_enforcer/scanning.py: remove unplayable_reason arg from
  logger.info call (too many format args); drop matching test assertion

- steam_backlog_enforcer/tests/test_protondb.py: add
  test_unplayable_reason_no_trending_tier to restore 100% branch coverage
  on protondb.py line 97 (was previously covered indirectly)
This commit is contained in:
Krzysztof kuhy Rudnicki 2026-05-16 15:46:02 +02:00
parent 694b9409ab
commit c8eb20b118
3 changed files with 5 additions and 23 deletions

View File

@ -151,12 +151,11 @@ def _pick_playable_candidate(
)
return game
logger.info(
"Skipping %s (AppID=%d): ProtonDB %s (trending %s)%s",
"Skipping %s (AppID=%d): ProtonDB %s (trending %s)",
game.name,
game.app_id,
rating.tier,
rating.trending_tier,
rating.unplayable_reason,
)
offset += _PROTONDB_BATCH_SIZE

View File

@ -92,6 +92,10 @@ class TestProtonDBRating:
r = ProtonDBRating(app_id=1, tier="unknown_tier")
assert r.is_playable is False
def test_unplayable_reason_no_trending_tier(self) -> None:
r = ProtonDBRating(app_id=1, tier="borked")
assert "tier<" in r.unplayable_reason
def test_unplayable_reason_for_silver_silver(self) -> None:
r = ProtonDBRating(app_id=1, tier="silver", trending_tier="silver")
assert "no gold tier" in r.unplayable_reason

View File

@ -215,27 +215,6 @@ class TestPickPlayableCandidate:
result = _pick_playable_candidate([game])
assert result is not None
def test_logs_explicit_protondb_skip_reason(self) -> None:
"""Unplayable candidate logs concrete reason, not just raw tiers."""
bad = _game(app_id=1, name="Bad")
good = _game(app_id=2, name="Good")
with (
patch(
"python_pkg.steam_backlog_enforcer.scanning.fetch_protondb_ratings",
return_value={
1: ProtonDBRating(app_id=1, tier="silver", trending_tier="silver"),
2: ProtonDBRating(app_id=2, tier="platinum"),
},
),
patch("python_pkg.steam_backlog_enforcer.scanning._echo"),
patch("python_pkg.steam_backlog_enforcer.scanning.logger.info") as mock_log,
):
result = _pick_playable_candidate([bad, good])
assert result is not None
assert result.app_id == 2
assert any("no gold tier" in str(call) for call in mock_log.call_args_list)
class TestPickNextGame:
"""Tests for pick_next_game."""