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.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
test: migrate agent drive end-user ORM models to real entities (#40654)
Asuka Minato97d34ae6bee1
diff --git a/api/tests/unit_tests/controllers/inner_api/plugin/test_agent_drive.py b/api/tests/unit_tests/controllers/inner_api/plugin/test_agent_drive.pyindex 8289a575050..08b336e1d31 100644--- a/api/tests/unit_tests/controllers/inner_api/plugin/test_agent_drive.py+++ b/api/tests/unit_tests/controllers/inner_api/plugin/test_agent_drive.py@@ -8,13 +8,14 @@ controller's request parsing + error mapping, not auth (tested separately).from __future__ import annotationsimport inspect-from types import SimpleNamespacefrom unittest.mock import ANY, patchimport pytestfrom flask import Flaskfrom controllers.inner_api.plugin.agent_drive import AgentDriveCommitApi, AgentDriveManifestApi, AgentDriveSkillsApi+from models.enums import EndUserType+from models.model import EndUserfrom services.agent_drive_service import AgentDriveError_MOD = "controllers.inner_api.plugin.agent_drive"@@ -25,6 +26,15 @@ def _raw(method):return inspect.unwrap(method)+def _end_user(user_id: str) -> EndUser:+ return EndUser(+ id=user_id,+ tenant_id="tenant-1",+ type=EndUserType.SERVICE_API,+ session_id="session-1",+ )++def test_manifest_parses_query_and_returns_items():raw = _raw(AgentDriveManifestApi.get)with app.test_request_context("/?tenant_id=tenant-1&prefix=docs/&include_download_url=true"):@@ -101,7 +111,7 @@ def test_commit_parses_body_and_returns_items():}with app.test_request_context("/", method="POST", json=payload):with (- patch(f"{_MOD}.get_user", return_value=SimpleNamespace(id="user-1")) as get_user,+ patch(f"{_MOD}.get_user", return_value=_end_user("user-1")) as get_user,patch(f"{_MOD}.AgentDriveService") as svc,):svc.return_value.commit.return_value = [{"key": "a.txt"}]@@ -121,7 +131,7 @@ def test_commit_canonicalizes_user_before_service_call():}with app.test_request_context("/", method="POST", json=payload):with (- patch(f"{_MOD}.get_user", return_value=SimpleNamespace(id="end-user-1")),+ patch(f"{_MOD}.get_user", return_value=_end_user("end-user-1")),patch(f"{_MOD}.AgentDriveService") as svc,):svc.return_value.commit.return_value = [{"key": "a.txt"}]@@ -148,7 +158,7 @@ def test_commit_maps_service_error():}with app.test_request_context("/", method="POST", json=payload):with (- patch(f"{_MOD}.get_user", return_value=SimpleNamespace(id="user-1")),+ patch(f"{_MOD}.get_user", return_value=_end_user("user-1")),patch(f"{_MOD}.AgentDriveService") as svc,):svc.return_value.commit.side_effect = AgentDriveError("source_not_found", "nope", status_code=404)