Skip to main content

✅ Select contract demon

CategoryAbility
StatusPassing
Testtests/test_turn_sequence.py::test_select_contract_demon

P1 selects "002" from hand as the contracted demon.

Preconditions

  • P1 hand = ["001", "002", "003"].

  • contracted_demons = {P1: None, P2: None}.

Action

  • select_contract_demon(state, Side.PLAYER_1, "002")
result = select_contract_demon(state, Side.PLAYER_1, "002")

Expected Postconditions

  • contracted_demons[P1] = "002".

  • P1 hand = ["001", "003"] ("002" removed).

  • contracted_demons[P2] = None (unchanged).

Assertions

assert result.contracted_demons[Side.PLAYER_1] == "002"
assert result.players[Side.PLAYER_1].hand == ["001", "003"]
assert result.contracted_demons[Side.PLAYER_2] is None
assert state.players[Side.PLAYER_1].hand == ["001", "002", "003"] # original not mutated