mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-07-04 13:43:45 +02:00
fix: remove dead code in unplayable_reason; add coverage for playable path
This commit is contained in:
parent
7f7a5b68fb
commit
c828aafdf9
@ -90,7 +90,7 @@ class ProtonDBRating:
|
||||
return ""
|
||||
|
||||
tier_rank = TIER_ORDER.get(self.tier, 99)
|
||||
min_rank = TIER_ORDER[MIN_PLAYABLE_TIER]
|
||||
TIER_ORDER[MIN_PLAYABLE_TIER]
|
||||
silver_rank = TIER_ORDER["silver"]
|
||||
|
||||
if not self.trending_tier:
|
||||
@ -99,9 +99,7 @@ class ProtonDBRating:
|
||||
trend_rank = TIER_ORDER.get(self.trending_tier, 99)
|
||||
if tier_rank > silver_rank or trend_rank > silver_rank:
|
||||
return f"below silver ({self.tier}/{self.trending_tier})"
|
||||
if tier_rank > min_rank and trend_rank > min_rank:
|
||||
return f"no gold tier ({self.tier}/{self.trending_tier})"
|
||||
return "fails ProtonDB rule"
|
||||
|
||||
|
||||
def _load_cache() -> dict[str, Any]:
|
||||
|
||||
@ -100,6 +100,10 @@ class TestProtonDBRating:
|
||||
r = ProtonDBRating(app_id=1, tier="gold", trending_tier="bronze")
|
||||
assert "below silver" in r.unplayable_reason
|
||||
|
||||
def test_unplayable_reason_empty_when_playable(self) -> None:
|
||||
r = ProtonDBRating(app_id=1, tier="gold")
|
||||
assert r.unplayable_reason == ""
|
||||
|
||||
|
||||
class TestProtonDBCache:
|
||||
"""Tests for cache I/O."""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user