From 78f313663e72544d6cbdc23481cfb5368fe30b68 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Mon, 6 Apr 2026 17:33:36 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20review=20feedback=20=E2=80=94=20variant?= =?UTF-8?q?=200=20guard,=20remove=20dead=20team=20param?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use `variant is None` instead of `not variant` to avoid skipping variant 0 tier-ups (0 is falsy in Python) - Remove unused `team` parameter from _build_refractor_response - Update tests to match Co-Authored-By: Claude Opus 4.6 (1M context) --- cogs/players.py | 2 -- command_logic/logic_gameplay.py | 2 +- tests/test_player_refractor_view.py | 7 ------- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/cogs/players.py b/cogs/players.py index b557041..ffaa81b 100644 --- a/cogs/players.py +++ b/cogs/players.py @@ -484,7 +484,6 @@ async def _build_refractor_response( player_name: str, player_id: int, refractor_tier: int, - team: dict, refractor_data: dict, ) -> dict: """Build response data for a /player refractor_tier request. @@ -771,7 +770,6 @@ class Players(commands.Cog): player_name=this_player, player_id=pid, refractor_tier=refractor_tier, - team=team, refractor_data=refractor_data, ) diff --git a/command_logic/logic_gameplay.py b/command_logic/logic_gameplay.py index bf158cf..846fe3e 100644 --- a/command_logic/logic_gameplay.py +++ b/command_logic/logic_gameplay.py @@ -4254,7 +4254,7 @@ async def _trigger_variant_renders(tier_ups: list) -> None: today = datetime.date.today().isoformat() for tier_up in tier_ups: variant = tier_up.get("variant_created") - if not variant: + if variant is None: continue player_id = tier_up["player_id"] track = tier_up.get("track_name", "Batter") diff --git a/tests/test_player_refractor_view.py b/tests/test_player_refractor_view.py index 9ab9b74..79317c7 100644 --- a/tests/test_player_refractor_view.py +++ b/tests/test_player_refractor_view.py @@ -17,8 +17,6 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) from cogs.players import _build_refractor_response -TEAM = {"id": 31, "name": "Test Team", "abbrev": "TST"} - REFRACTOR_CARDS_RESPONSE = { "count": 3, "items": [ @@ -67,7 +65,6 @@ class TestBuildRefractorResponse: player_name="Mike Trout", player_id=100, refractor_tier=3, - team=TEAM, refractor_data=REFRACTOR_CARDS_RESPONSE, ) assert result["found"] is True @@ -85,7 +82,6 @@ class TestBuildRefractorResponse: player_name="Nobody", player_id=999, refractor_tier=2, - team=TEAM, refractor_data=REFRACTOR_CARDS_RESPONSE, ) assert result["found"] is False @@ -104,7 +100,6 @@ class TestBuildRefractorResponse: player_name="Ken Griffey Jr.", player_id=300, refractor_tier=1, - team=TEAM, refractor_data=REFRACTOR_CARDS_RESPONSE, ) assert result["found"] is True @@ -124,7 +119,6 @@ class TestBuildRefractorResponse: player_name="Someone", player_id=500, refractor_tier=1, - team=TEAM, refractor_data=empty_data, ) assert result["found"] is False @@ -142,7 +136,6 @@ class TestBuildRefractorResponse: player_name="Mike Trout", player_id=100, refractor_tier=4, - team=TEAM, refractor_data=REFRACTOR_CARDS_RESPONSE, ) assert result["found"] is False