diff --git a/api/controllers/console/app/workflow.py b/api/controllers/console/app/workflow.py index 47359f902e..aa5eb93489 100644 --- a/api/controllers/console/app/workflow.py +++ b/api/controllers/console/app/workflow.py @@ -6,7 +6,8 @@ from typing import Any from flask import abort, request from flask_restx import Resource, fields, marshal_with from graphon.enums import NodeType -from graphon.file import File, helpers as file_helpers +from graphon.file import File +from graphon.file import helpers as file_helpers from graphon.graph_engine.manager import GraphEngineManager from graphon.model_runtime.utils.encoders import jsonable_encoder from pydantic import BaseModel, Field, ValidationError, field_validator diff --git a/api/tests/unit_tests/controllers/console/app/test_workflow.py b/api/tests/unit_tests/controllers/console/app/test_workflow.py index 3bfda0d1a8..f330018d40 100644 --- a/api/tests/unit_tests/controllers/console/app/test_workflow.py +++ b/api/tests/unit_tests/controllers/console/app/test_workflow.py @@ -293,9 +293,7 @@ def test_advanced_chat_run_conversation_not_exists(app, monkeypatch: pytest.Monk handler(api, app_model=SimpleNamespace(id="app")) -def test_workflow_online_users_filters_inaccessible_workflow( - app, monkeypatch: pytest.MonkeyPatch -) -> None: +def test_workflow_online_users_filters_inaccessible_workflow(app, monkeypatch: pytest.MonkeyPatch) -> None: app_id_1 = "11111111-1111-1111-1111-111111111111" app_id_2 = "22222222-2222-2222-2222-222222222222" signed_avatar_url = "https://files.example.com/signed/avatar-1" @@ -353,9 +351,7 @@ def test_workflow_online_users_filters_inaccessible_workflow( sign_avatar.assert_called_once_with("avatar-file-id") -def test_workflow_online_users_rejects_excessive_workflow_ids( - app, monkeypatch: pytest.MonkeyPatch -) -> None: +def test_workflow_online_users_rejects_excessive_workflow_ids(app, monkeypatch: pytest.MonkeyPatch) -> None: monkeypatch.setattr(workflow_module, "current_account_with_tenant", lambda: (SimpleNamespace(), "tenant-1")) accessible_app_ids = Mock(return_value=set()) monkeypatch.setattr( @@ -364,9 +360,7 @@ def test_workflow_online_users_rejects_excessive_workflow_ids( lambda: SimpleNamespace(get_accessible_app_ids=accessible_app_ids), ) - excessive_ids = ",".join( - f"wf-{index}" for index in range(workflow_module.MAX_WORKFLOW_ONLINE_USERS_QUERY_IDS + 1) - ) + excessive_ids = ",".join(f"wf-{index}" for index in range(workflow_module.MAX_WORKFLOW_ONLINE_USERS_QUERY_IDS + 1)) api = workflow_module.WorkflowOnlineUsersApi() handler = _unwrap(api.get) diff --git a/api/tests/unit_tests/controllers/console/app/test_workflow_comment_api.py b/api/tests/unit_tests/controllers/console/app/test_workflow_comment_api.py index 0c1a9b38a4..85afcf0e60 100644 --- a/api/tests/unit_tests/controllers/console/app/test_workflow_comment_api.py +++ b/api/tests/unit_tests/controllers/console/app/test_workflow_comment_api.py @@ -129,9 +129,7 @@ class WriteCase: ), ], ) -def test_write_endpoints_require_edit_permission( - app: Flask, monkeypatch: pytest.MonkeyPatch, case: WriteCase -) -> None: +def test_write_endpoints_require_edit_permission(app: Flask, monkeypatch: pytest.MonkeyPatch, case: WriteCase) -> None: app.config.setdefault("RESTX_MASK_HEADER", "X-Fields") account = _make_account(TenantAccountRole.NORMAL) app_model = _make_app()