From c8eb20b118c16067146e21b7792e672797203405 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Sat, 16 May 2026 15:46:02 +0200 Subject: [PATCH] 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) --- steam_backlog_enforcer/scanning.py | 3 +-- steam_backlog_enforcer/tests/test_protondb.py | 4 ++++ steam_backlog_enforcer/tests/test_scanning.py | 21 ------------------- 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/steam_backlog_enforcer/scanning.py b/steam_backlog_enforcer/scanning.py index cee8b95..0d21e1d 100644 --- a/steam_backlog_enforcer/scanning.py +++ b/steam_backlog_enforcer/scanning.py @@ -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 diff --git a/steam_backlog_enforcer/tests/test_protondb.py b/steam_backlog_enforcer/tests/test_protondb.py index 2a0caa1..55f2069 100644 --- a/steam_backlog_enforcer/tests/test_protondb.py +++ b/steam_backlog_enforcer/tests/test_protondb.py @@ -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 diff --git a/steam_backlog_enforcer/tests/test_scanning.py b/steam_backlog_enforcer/tests/test_scanning.py index de058ec..98be132 100644 --- a/steam_backlog_enforcer/tests/test_scanning.py +++ b/steam_backlog_enforcer/tests/test_scanning.py @@ -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."""