Skip to content

Instantly share code, notes, and snippets.

@jeanmidevacc
Created March 17, 2026 02:24
Show Gist options
  • Select an option

  • Save jeanmidevacc/573dfd0a51ced51ae00de60ecb1a4c41 to your computer and use it in GitHub Desktop.

Select an option

Save jeanmidevacc/573dfd0a51ced51ae00de60ecb1a4c41 to your computer and use it in GitHub Desktop.
### Part around unit tests
import pytest
from pyscoundrel.models.card import Card, CardType
pytestmark = pytest.mark.unit
class TestCardFromDungeonCard:
def test_creates_card_with_correct_fields(self):
card = Card.from_dungeon_card(
card_id="goblin_01",
name="Goblin",
card_type=CardType.MONSTER,
value=5,
)
assert card.card_id == "goblin_01"
assert card.name == "Goblin"
assert card.card_type == CardType.MONSTER
assert card.value == 5
def test_weapon_card(self):
card = Card.from_dungeon_card("sword_01", "Iron Sword", CardType.WEAPON, 8)
assert card.card_type == CardType.WEAPON
assert card.value == 8
### Part around integration tests
import pytest
from pyscoundrel.game.engine import GameEngine
from .conftest import run_game
pytestmark = pytest.mark.integration
class TestAgentCompletesGame:
def test_barehanded_agent_finishes_game(self, engine, barehanded_agent):
state = run_game(engine, barehanded_agent)
assert state.game_over is True
def test_weapon_first_agent_finishes_game(self, engine, weapon_first_agent):
state = run_game(engine, weapon_first_agent)
assert state.game_over is True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment