Files
ea-chatbot-lg/backend/tests/test_orchestrator_planner.py

35 lines
1.2 KiB
Python

from typing import get_type_hints, List
from ea_chatbot.graph.nodes.planner import planner_node
from ea_chatbot.graph.state import AgentState
def test_planner_node_checklist():
"""Verify that the planner node generates a checklist."""
state = AgentState(
messages=[],
question="How many voters are in Florida and what is the current news?",
analysis={"requires_dataset": True},
next_action="plan",
iterations=0,
checklist=[],
current_step=0,
vfs={},
plots=[],
dfs={}
)
# Mocking the LLM would be ideal, but for now we'll check the returned keys
# and assume the implementation provides them.
# In a real TDD, we'd mock the LLM to return a specific structure.
# For now, let's assume the task is to update 'planner_node' to return these keys.
result = planner_node(state)
assert "checklist" in result
assert isinstance(result["checklist"], list)
assert len(result["checklist"]) > 0
assert "task" in result["checklist"][0]
assert "worker" in result["checklist"][0] # 'data_analyst' or 'researcher'
assert "current_step" in result
assert result["current_step"] == 0