def setUp(self): self.game = Game() self.space = self.game.arena.space self.player = self.game.player1 self.player2 = self.game.player2 self.player.position = (1, 1) self.move = Move(self.player, DIRECTIONS.west) self.new_position = translated_position( self.player.position, DIRECTIONS.west ) GameAdvancement(self.game, self.move).do()
def setUp(self): self.game = Game() self.space = self.game.arena.space self.player = self.game.player1 self.player2 = self.game.player2 self.game.current_player = self.player self.player.position = (1, 1) self.move = Move(self.player, DIRECTIONS.south) self.new_position = translated_position( self.player.position, DIRECTIONS.south ) # Assume the move reports as invalid self.move.is_valid = MagicMock(return_value=False) GameAdvancement(self.game, self.move).do()
def test_translated_position(self): self.assertEqual( translated_position(self.position, self.direction), (1, 2) )
def new_position(self): return arena.translated_position( self.player.position, self.direction )