fix: address review feedback (#164)
All checks were successful
Ruff Lint / lint (pull_request) Successful in 17s
All checks were successful
Ruff Lint / lint (pull_request) Successful in 17s
- Fix falsy-zero bug: `(loss_max or 99)` → `loss_max is not None and losses > loss_max` so a player finishing 10-1 sees ❌ on the perfect-run bonus instead of ⬜ - Tighten test assertion: assert "❌" in bonus_line (was: assert "✅" not in bonus_line) - Revert in_game/gameplay_queries.py to main — formatting/NoResultFound changes belong in PR #163, not here Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9228d2e66c
commit
079f9ac4f6
@ -2472,7 +2472,13 @@ def build_gauntlet_recap_embed(
|
|||||||
if loss_max is not None
|
if loss_max is not None
|
||||||
else wins >= win_num
|
else wins >= win_num
|
||||||
)
|
)
|
||||||
marker = "✅" if earned else "❌" if losses > (loss_max or 99) else "⬜"
|
marker = (
|
||||||
|
"✅"
|
||||||
|
if earned
|
||||||
|
else "❌"
|
||||||
|
if loss_max is not None and losses > loss_max
|
||||||
|
else "⬜"
|
||||||
|
)
|
||||||
|
|
||||||
reward = r.get("reward", {})
|
reward = r.get("reward", {})
|
||||||
if reward.get("money"):
|
if reward.get("money"):
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -204,11 +204,11 @@ class TestBuildGauntletRecapEmbed:
|
|||||||
make_run(wins=10, losses=1), make_event(), make_main_team(), make_rewards()
|
make_run(wins=10, losses=1), make_event(), make_main_team(), make_rewards()
|
||||||
)
|
)
|
||||||
prize_field = next(f for f in embed.fields if f.name == "Prize Distribution")
|
prize_field = next(f for f in embed.fields if f.name == "Prize Distribution")
|
||||||
# The 10-0 bonus line must appear without ✅ (either ❌ or ⬜)
|
# The 10-0 bonus line must appear with ❌ — definitively missed, not pending (⬜)
|
||||||
lines = prize_field.value.split("\n")
|
lines = prize_field.value.split("\n")
|
||||||
bonus_line = next((line for line in lines if "10-0" in line), None)
|
bonus_line = next((line for line in lines if "10-0" in line), None)
|
||||||
assert bonus_line is not None, "Expected a '10-0' line in prizes"
|
assert bonus_line is not None, "Expected a '10-0' line in prizes"
|
||||||
assert "✅" not in bonus_line
|
assert "❌" in bonus_line
|
||||||
|
|
||||||
def test_empty_rewards_list_omits_prize_field(self):
|
def test_empty_rewards_list_omits_prize_field(self):
|
||||||
"""When rewards is an empty list the Prize Distribution field must be omitted.
|
"""When rewards is an empty list the Prize Distribution field must be omitted.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user