From c7035748ebf216f5e6e0406a600e5c1badb3e7fe Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Wed, 23 Sep 2026 17:17:26 -0400 Subject: [PATCH] test(sports): pin that an ambiguous NRL abbreviation tints in both modes NRL's resolver passes a shared abbreviation ("NEW") through with an error and its _is_favorite_game matches ids only, but both favourite-colour helpers match on abbreviation as well, so both display modes tint a Knights or Warriors result for a user who typed "NEW". The twins agree; neither consults the _favorite_key seam. Pinned so a fix is deliberate. Co-Authored-By: Claude Opus 5.5 --- test/test_sports_twins.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/test_sports_twins.py b/test/test_sports_twins.py index d98e33aa..4202468d 100644 --- a/test/test_sports_twins.py +++ b/test/test_sports_twins.py @@ -472,6 +472,24 @@ class TestIdentical: assert host._favorite_result(game) == expected assert C.favorite_result({"favorite_teams": favs}, game) == expected + def test_an_ambiguous_nrl_abbreviation_tints_on_both_sides(self): + """Agreed -- and at odds with NRL's own favourite rule. + + NRL's resolver logs a shared abbreviation ("NEW") as an error and + passes it through unchanged, and its _is_favorite_game matches ids + only, so selection never treats "NEW" as a favourite. Both colour + helpers match on abbreviation too, so both modes tint a Knights result + (and a Warriors one) for a user who typed "NEW". Not a twin + divergence; a seam neither helper consults. + """ + on = {"customization": {"favorite_result_colors": {"enabled": True}}} + game = {"league": "3", "home_abbr": "NEW", "home_id": "4", "home_score": "20", + "away_abbr": "MEL", "away_id": "12", "away_score": "10", + "favorite_teams": ["NEW"]} + cfg = dict(on, favorite_teams=["NEW"]) + assert _Host(cfg, favorites=["NEW"])._recent_score_color(game, (9, 9, 9)) \ + == C.recent_score_color(cfg, LOG, game, (9, 9, 9)) == (0, 255, 0) + # --------------------------------------------------------------------------- # Pinned divergences -- owner decision pending. Edit deliberately.