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

Method test_parse_tie

tests/arenas/test_scml.py:161–175  ·  view source on GitHub ↗
(self, tmp_log_dir)

Source from the content-addressed store, hash-verified

159 assert stats.details == ['{"sim": 0, "player": "Alice", "score": 1.25}']
160
161 def test_parse_tie(self, tmp_log_dir):
162 arena = SCMLOneShotArena.__new__(SCMLOneShotArena)
163 arena.log_local = tmp_log_dir
164 arena.logger = type("Logger", (), {"error": lambda self, msg: None})()
165 round_dir = tmp_log_dir / "rounds" / "1"
166 round_dir.mkdir(parents=True)
167 (round_dir / "scml_results.json").write_text(json.dumps({"average_scores": {"Alice": 1, "Bob": 1}}))
168
169 agents = [MockPlayer("Alice"), MockPlayer("Bob")]
170 stats = RoundStats(round_num=1, agents=agents)
171
172 arena.get_results(agents, 1, stats)
173
174 assert stats.winner == RESULT_TIE
175 assert stats.scores == {"Alice": 1.0, "Bob": 1.0}
176
177 def test_missing_results_file_penalizes_all_players(self, tmp_log_dir):
178 arena = SCMLOneShotArena.__new__(SCMLOneShotArena)

Callers

nothing calls this directly

Calls 3

RoundStatsClass · 0.90
MockPlayerClass · 0.85
get_resultsMethod · 0.45

Tested by

no test coverage detected