def test_resilient_player_moves(self): """ Check that the resilient player step counter works """ board = cs.Board() player = cs.ResilientPlayer(board) player.move() player.move() assert player.step_counter() == 2
def test_resilience(self): """ Checks that the resilient player moves extra steps after falling down a chute in the next move """ board = cs.Board(chutes=([6, 1], [5, 1], [4, 1], [3, 1], [2, 1])) player = cs.ResilientPlayer(board, extra_steps=20) player.move() player.move() assert player.position >= 21 player.move() assert player.position >= 27
def test_move(self): """ResilientPlayer can move.""" b = cs.Board() p = cs.ResilientPlayer(b) p.move()
def test_constructor(self): """ResilientPlayer can be created.""" b = cs.Board() p = cs.ResilientPlayer(b, extra_steps=4) assert isinstance(p, cs.ResilientPlayer) assert isinstance(p, cs.Player)