Created
March 17, 2026 02:24
-
-
Save jeanmidevacc/573dfd0a51ced51ae00de60ecb1a4c41 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### 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