(self, mock_player_factory)
| 30 | assert error is None |
| 31 | |
| 32 | def test_missing_decide(self, mock_player_factory): |
| 33 | arena = SCMLOneShotArena.__new__(SCMLOneShotArena) |
| 34 | arena.submission = "scml_agent.py" |
| 35 | player = mock_player_factory( |
| 36 | name="Alice", |
| 37 | files={"scml_agent.py": "class OtherAgent:\n pass\n"}, |
| 38 | command_outputs={ |
| 39 | "test -f scml_agent.py && echo exists": {"output": "exists\n", "returncode": 0}, |
| 40 | "cat scml_agent.py": {"output": "class OtherAgent:\n pass\n", "returncode": 0}, |
| 41 | "python -m py_compile scml_agent.py": {"output": "", "returncode": 0}, |
| 42 | "python - <<'PY'": {"output": "decide function not found", "returncode": 1}, |
| 43 | }, |
| 44 | ) |
| 45 | |
| 46 | valid, error = arena.validate_code(player) |
| 47 | |
| 48 | assert valid is False |
| 49 | assert "Could not import" in error |
| 50 | |
| 51 | def test_import_failure(self, mock_player_factory): |
| 52 | arena = SCMLOneShotArena.__new__(SCMLOneShotArena) |
nothing calls this directly
no test coverage detected