def __init__(self, tc): gtp_engine_fixtures.Mock_subprocess_fixture.__init__(self, tc) self.player = game_jobs.Player() self.player.code = 'test' self.player.cmd_args = ['test', 'id=test'] self.check = game_jobs.Player_check() self.check.player = self.player self.check.board_size = 9 self.check.komi = 7.0
def __init__(self, tc): gtp_engine_fixtures.Mock_subprocess_fixture.__init__(self, tc) player_b = game_jobs.Player() player_b.code = 'one' player_b.cmd_args = ['testb', 'id=one'] player_w = game_jobs.Player() player_w.code = 'two' player_w.cmd_args = ['testw', 'id=two'] self.job = Test_game_job() self.job.game_id = 'gameid' self.job.player_b = player_b self.job.player_w = player_w self.job.board_size = 9 self.job.komi = 7.5 self.job.move_limit = 1000 self.job.sgf_dirname = "/sgf/test.games" self.job.void_sgf_dirname = "/sgf/test.void" self.job.sgf_filename = "gjtest.sgf" self._ctr = 0 self._players = {'b': player_b, 'w': player_w}
def game_jobs_player_from_config(self, code, player_config): """Make a game_jobs.Player from a Player_config. Raises ControlFileError with a description if there is an error in the configuration. Returns a game_jobs.Player. """ arguments = player_config.resolve_arguments() config = load_settings(_player_settings, arguments) player = game_jobs.Player() player.code = code try: player.cmd_args = config['command'] if '/' in player.cmd_args[0]: player.cmd_args[0] = self.resolve_pathname(player.cmd_args[0]) except Exception, e: raise ControlFileError("'command': %s" % e)