mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-18 20:14:44 +08:00
fix: fix the lint check errors of the main branch (#403)
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
from collections import namedtuple
|
||||
import json
|
||||
import pytest
|
||||
import asyncio
|
||||
import types
|
||||
from unittest.mock import patch, MagicMock, AsyncMock
|
||||
from unittest.mock import patch, MagicMock
|
||||
from src.graph.nodes import planner_node
|
||||
from src.graph.nodes import human_feedback_node
|
||||
from src.graph.nodes import coordinator_node
|
||||
@@ -39,7 +37,7 @@ def mock_state():
|
||||
@pytest.fixture
|
||||
def mock_configurable():
|
||||
mock = MagicMock()
|
||||
mock.max_search_results = 5
|
||||
mock.max_search_results = 7
|
||||
return mock
|
||||
|
||||
|
||||
@@ -668,8 +666,6 @@ def test_coordinator_node_tool_calls_exception_handling(
|
||||
patch_handoff_to_planner,
|
||||
patch_logger,
|
||||
):
|
||||
# tool_calls raises exception in processing
|
||||
tool_calls = [{"name": "handoff_to_planner", "args": None}]
|
||||
with (
|
||||
patch("src.graph.nodes.AGENT_LLM_MAP", {"coordinator": "basic"}),
|
||||
patch("src.graph.nodes.get_llm_by_type") as mock_get_llm,
|
||||
@@ -1037,24 +1033,6 @@ async def test_execute_agent_step_recursion_limit_env_negative(
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_state_with_steps(mock_step, mock_completed_step):
|
||||
# Simulate a plan with one completed and one unexecuted step
|
||||
Plan = MagicMock()
|
||||
Plan.steps = [mock_completed_step, mock_step]
|
||||
return {
|
||||
"current_plan": Plan,
|
||||
"observations": ["obs1"],
|
||||
"locale": "en-US",
|
||||
"resources": [],
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_config():
|
||||
return MagicMock()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_configurable_with_mcp():
|
||||
mock = MagicMock()
|
||||
@@ -1297,27 +1275,6 @@ def mock_state_without_resources():
|
||||
return {"other": "value"}
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_config():
|
||||
return MagicMock()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_configurable():
|
||||
mock = MagicMock()
|
||||
mock.max_search_results = 7
|
||||
return mock
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def patch_config_from_runnable_config(mock_configurable):
|
||||
with patch(
|
||||
"src.graph.nodes.Configuration.from_runnable_config",
|
||||
return_value=mock_configurable,
|
||||
):
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def patch_get_web_search_tool():
|
||||
with patch("src.graph.nodes.get_web_search_tool") as mock:
|
||||
|
||||
Reference in New Issue
Block a user