(self, mock_player_factory)
| 11 | |
| 12 | class TestSCMLValidation: |
| 13 | def test_valid_agent(self, mock_player_factory): |
| 14 | arena = SCMLOneShotArena.__new__(SCMLOneShotArena) |
| 15 | arena.submission = "scml_agent.py" |
| 16 | player = mock_player_factory( |
| 17 | name="Alice", |
| 18 | files={"scml_agent.py": "def decide(observation):\n return {}\n"}, |
| 19 | command_outputs={ |
| 20 | "test -f scml_agent.py && echo exists": {"output": "exists\n", "returncode": 0}, |
| 21 | "cat scml_agent.py": {"output": "def decide(observation):\n return {}\n", "returncode": 0}, |
| 22 | "python -m py_compile scml_agent.py": {"output": "", "returncode": 0}, |
| 23 | "python - <<'PY'": {"output": "", "returncode": 0}, |
| 24 | }, |
| 25 | ) |
| 26 | |
| 27 | valid, error = arena.validate_code(player) |
| 28 | |
| 29 | assert valid is True |
| 30 | assert error is None |
| 31 | |
| 32 | def test_missing_decide(self, mock_player_factory): |
| 33 | arena = SCMLOneShotArena.__new__(SCMLOneShotArena) |
nothing calls this directly
no test coverage detected