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
refactor(test): replace SimpleNamespace with typed mocks in schedule service tests (#38393)
ojasarora.eth09c5c5e5ed3f
diff --git a/api/tests/unit_tests/services/test_schedule_service.py b/api/tests/unit_tests/services/test_schedule_service.pyindex 0f8f7ffab58..d5006bd5f26 100644--- a/api/tests/unit_tests/services/test_schedule_service.py+++ b/api/tests/unit_tests/services/test_schedule_service.py@@ -1,7 +1,7 @@+import jsonimport unittestfrom datetime import UTC, datetime-from types import SimpleNamespace-from typing import Any, cast+from typing import Anyfrom unittest.mock import MagicMock, Mockimport pytest@@ -11,7 +11,7 @@ from core.trigger.constants import TRIGGER_SCHEDULE_NODE_TYPEfrom core.workflow.nodes.trigger_schedule.entities import VisualConfigfrom core.workflow.nodes.trigger_schedule.exc import ScheduleConfigErrorfrom libs.schedule_utils import calculate_next_run_at, convert_12h_to_24h-from models.workflow import Workflow+from models.workflow import Workflow, WorkflowTypefrom services.trigger.schedule_service import ScheduleService@@ -503,7 +503,22 @@ def session_mock() -> MagicMock:def _workflow(**kwargs: Any) -> Workflow:- return cast(Workflow, SimpleNamespace(**kwargs))+ graph_dict = kwargs.pop("graph_dict", {})+ workflow = Workflow.new(+ tenant_id="tenant-1",+ app_id="app-1",+ type=WorkflowType.WORKFLOW,+ version="draft",+ graph=json.dumps(graph_dict),+ features="{}",+ created_by="account-1",+ environment_variables=[],+ conversation_variables=[],+ rag_pipeline_variables=[],+ )+ for key, value in kwargs.items():+ setattr(workflow, key, value)+ return workflowdef test_to_schedule_config_should_build_from_cron_mode() -> None: