Download tests/unit/test_planner.py from jayc1978/aegis: direct link, hf CLI and curl.
- Browser
- Download file 1.34 kB
-
https://huggingface.co/jayc1978/aegis/resolve/main/tests/unit/test_planner.py
- Command line
-
hf download hf://jayc1978/aegis/tests/unit/test_planner.py
-
curl -L -o test_planner.py https://huggingface.co/jayc1978/aegis/resolve/main/tests/unit/test_planner.py
1.34 kB
| import pytest | |
| from aegis.agents import PlannerAgent | |
| from aegis.core import AgentContext, Task | |
| async def test_planner_returns_structured_plan() -> None: | |
| planner = PlannerAgent() | |
| context = AgentContext( | |
| task=Task( | |
| name="Build API", | |
| description="Create and validate a small API endpoint.", | |
| ) | |
| ) | |
| result = await planner.run(context) | |
| assert result.success is True | |
| assert result.agent_name == "planner" | |
| assert result.output["task_name"] == "Build API" | |
| assert len(result.output["steps"]) == 3 | |
| async def test_planner_steps_have_sequential_ids() -> None: | |
| planner = PlannerAgent() | |
| context = AgentContext( | |
| task=Task( | |
| name="Validate repository", | |
| description="Run repository validation checks.", | |
| ) | |
| ) | |
| result = await planner.run(context) | |
| step_ids = [step["id"] for step in result.output["steps"]] | |
| assert step_ids == [1, 2, 3] | |
| async def test_planner_output_is_bounded() -> None: | |
| planner = PlannerAgent() | |
| context = AgentContext( | |
| task=Task( | |
| name="Small task", | |
| description="Produce a concise execution plan.", | |
| ) | |
| ) | |
| result = await planner.run(context) | |
| assert len(result.output["steps"]) <= 3 | |