def test_make_sgf(tc): fx = Game_fixture(tc) fx.game.use_internal_scorer() fx.game.ready() fx.game.run() fx.game.close_players() tc.assertMultiLineEqual(fx.sgf_string(), """\ (;FF[4]AP[gomill:VER]CA[UTF-8]DT[***]GM[1]KM[0]RE[B+18]SZ[9];B[ei];W[gi];B[eh];W[gh];B[eg];W[gg];B[ef];W[gf];B[ee];W[ge];B[ed];W[gd];B[ec];W[gc];B[eb];W[gb];B[ea];W[ga];B[tt];C[one beat two B+18]W[tt]) """) tc.assertMultiLineEqual(gomill_test_support.scrub_sgf( fx.game.make_sgf(game_end_message="zzzz").serialise(wrap=None)), """\ (;FF[4]AP[gomill:VER]CA[UTF-8]DT[***]GM[1]KM[0]RE[B+18]SZ[9];B[ei];W[gi];B[eh];W[gh];B[eg];W[gg];B[ef];W[gf];B[ee];W[ge];B[ed];W[gd];B[ec];W[gc];B[eb];W[gb];B[ea];W[ga];B[tt];C[one beat two B+18 zzzz]W[tt]) """)
def _get_sgf_written(self): """Return the 'scrubbed' sgf contents.""" return gomill_test_support.scrub_sgf(self._sgf_written)
def sgf_string(self): return gomill_test_support.scrub_sgf( self.game.make_sgf().serialise(wrap=None))
def sgf_string(self): return gomill_test_support.scrub_sgf( self.game_runner.make_sgf().serialise(wrap=None))