Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

test: use unbound_session for legacy agent node validator test (#44996)

hjeesum86f0bf1a8b37
diff --git a/api/tests/unit_tests/core/workflow/nodes/agent_v2/test_validators.py b/api/tests/unit_tests/core/workflow/nodes/agent_v2/test_validators.py
index d3526c85ee1..f9b2fc7e074 100644
--- a/api/tests/unit_tests/core/workflow/nodes/agent_v2/test_validators.py
+++ b/api/tests/unit_tests/core/workflow/nodes/agent_v2/test_validators.py
@@ -137,16 +137,13 @@ def _tool_graph(tool_data: dict) -> dict:
}
-def test_historical_agent_version_two_is_not_validated_as_dify_agent() -> None:
+def test_historical_agent_version_two_is_not_validated_as_dify_agent(unbound_session: Session) -> None:
graph = {
"nodes": [{"id": "legacy-agent", "data": {"type": "agent", "version": "2"}}],
"edges": [],
}
- session = Mock()
-
- WorkflowAgentNodeValidator.validate_published_workflow(session=session, workflow=_workflow(graph))
- session.scalar.assert_not_called()
+ WorkflowAgentNodeValidator.validate_published_workflow(session=unbound_session, workflow=_workflow(graph))
def _persist_validation_scope(