Skip to main content

✅ Execute ability does not mutate input state

CategoryAbility
StatusPassing
Testtests/test_abilities_registry.py::test_execute_ability_does_not_mutate_input_state

execute_ability must return a NEW state without mutating the input.

Preconditions

  • P1 Main Phase, P1 has 5 AP

  • Lane 0: P1's Sabnock ("003") — READIED

  • Handler registered, no-op

Action

  • execute_ability(state, demon, 0)

Expected Postconditions

  • Original state.players[P1].ap is still 5.

  • Original demon (on original state) is still READIED.

  • Result state is a different object.

Assertions

assert state.players[Side.PLAYER_1].ap == original_ap
assert result is not state