Fix: the test errors of test_nodes (#345)

This commit is contained in:
Willem Jiang
2025-06-18 11:59:33 +08:00
committed by GitHub
parent c0b04aaba2
commit 89f3d731c9

View File

@@ -161,6 +161,7 @@ def mock_state_planner():
def mock_configurable_planner(): def mock_configurable_planner():
mock = MagicMock() mock = MagicMock()
mock.max_plan_iterations = 3 mock.max_plan_iterations = 3
mock.enable_deep_thinking = False
return mock return mock
@@ -213,7 +214,7 @@ def test_planner_node_basic_has_enough_context(
patch_ai_message, patch_ai_message,
mock_plan, mock_plan,
): ):
# AGENT_LLM_MAP["planner"] == "basic" # AGENT_LLM_MAP["planner"] == "basic" and not thinking mode
with ( with (
patch("src.graph.nodes.AGENT_LLM_MAP", {"planner": "basic"}), patch("src.graph.nodes.AGENT_LLM_MAP", {"planner": "basic"}),
patch("src.graph.nodes.get_llm_by_type") as mock_get_llm, patch("src.graph.nodes.get_llm_by_type") as mock_get_llm,
@@ -241,7 +242,7 @@ def test_planner_node_basic_not_enough_context(
patch_plan_model_validate, patch_plan_model_validate,
patch_ai_message, patch_ai_message,
): ):
# AGENT_LLM_MAP["planner"] == "basic" # AGENT_LLM_MAP["planner"] == "basic" and not thinking mode
plan = { plan = {
"has_enough_context": False, "has_enough_context": False,
"title": "Test Plan", "title": "Test Plan",