MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / _write_pgn

Method _write_pgn

tests/arenas/test_chess.py:127–137  ·  view source on GitHub ↗
(self, file_path, white: str, black: str, result: str)

Source from the content-addressed store, hash-verified

125 pairings_file.write_text(json.dumps(pairings, indent=2))
126
127 def _write_pgn(self, file_path, white: str, black: str, result: str):
128 content = (
129 """
130[Event "FastChess Match"]
131[Site "-"]
132[Date "2026.01.07"]
133[Round "1"]
134""".strip()
135 + f'\n[White "{white}"]\n[Black "{black}"]\n[Result "{result}"]\n\n'
136 )
137 file_path.write_text(content)
138
139 def test_player1_wins(self, arena, tmp_log_dir):
140 """Alice wins one match; overall winner is Alice."""

Callers 4

test_player1_winsMethod · 0.95
test_player2_winsMethod · 0.95
test_all_drawsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected