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