Spaces:
Runtime error
Runtime error
| """template emits a compact coordinate frame (not a full ASCII map).""" | |
| from __future__ import annotations | |
| import random | |
| import proteus.game.scenarios # noqa: F401 | |
| from proteus.game.engine.difficulty import Difficulty | |
| from proteus.game.engine.grid import MotiveGridGame | |
| from proteus.game.scenarios.base import get_scenario | |
| def test_template_render_frame_is_compact(): | |
| scenario = get_scenario("template")() | |
| game = MotiveGridGame(scenario, random.Random(42), Difficulty.EASY, max_steps=10) | |
| frame = scenario.render_frame(game) | |
| assert "Open field 64x64" in frame | |
| assert "Walls (blocked rectangles" in frame # terrain described, not drawn | |
| # A few prose lines (coords + a wall rectangle list), nowhere near a | |
| # 4096-char ASCII map. Each non-empty line is itself short. | |
| assert len(frame) < 600 | |
| assert all(len(line) < 300 for line in frame.splitlines()) | |