fix: add missing pack, description, image fields to scouting test fixtures
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
875d5a8527
commit
0432f9d3f4
@ -12,19 +12,29 @@ from discord.ext import commands
|
|||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
def _make_player(player_id, name, rarity_name, rarity_value, headshot=None):
|
def _make_player(
|
||||||
|
player_id,
|
||||||
|
name,
|
||||||
|
rarity_name,
|
||||||
|
rarity_value,
|
||||||
|
headshot=None,
|
||||||
|
description="2023",
|
||||||
|
image=None,
|
||||||
|
):
|
||||||
"""Build a minimal player dict matching the API shape used by scouting."""
|
"""Build a minimal player dict matching the API shape used by scouting."""
|
||||||
return {
|
return {
|
||||||
"player_id": player_id,
|
"player_id": player_id,
|
||||||
"p_name": name,
|
"p_name": name,
|
||||||
"rarity": {"name": rarity_name, "value": rarity_value, "color": "ffffff"},
|
"rarity": {"name": rarity_name, "value": rarity_value, "color": "ffffff"},
|
||||||
"headshot": headshot or "https://example.com/headshot.jpg",
|
"headshot": headshot or "https://example.com/headshot.jpg",
|
||||||
|
"description": description,
|
||||||
|
"image": image or f"https://example.com/cards/{player_id}/battingcard.png",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _make_card(card_id, player):
|
def _make_card(card_id, player, pack_id=100):
|
||||||
"""Wrap a player dict inside a card dict (as returned by the cards API)."""
|
"""Wrap a player dict inside a card dict (as returned by the cards API)."""
|
||||||
return {"id": card_id, "player": player}
|
return {"id": card_id, "player": player, "pack": {"id": pack_id}}
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user