fix: remove enable for get (#35245)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Joel <iamjoel007@gmail.com>
This commit is contained in:
zyssyz123
2026-04-15 09:18:29 +00:00
committed by GitHub
co-authored by autofix-ci[bot] Joel
parent fb17339d89
commit e3c2116501
4 changed files with 48 additions and 24 deletions
+2 -6
View File
@@ -169,6 +169,7 @@ console_ns.schema_model(
class TrialAppWorkflowRunApi(TrialAppResource):
@trial_feature_enable
@console_ns.expect(console_ns.models[WorkflowRunRequest.__name__])
def post(self, trial_app):
"""
@@ -210,6 +211,7 @@ class TrialAppWorkflowRunApi(TrialAppResource):
class TrialAppWorkflowTaskStopApi(TrialAppResource):
@trial_feature_enable
def post(self, trial_app, task_id: str):
"""
Stop workflow task
@@ -290,7 +292,6 @@ class TrialChatApi(TrialAppResource):
class TrialMessageSuggestedQuestionApi(TrialAppResource):
@trial_feature_enable
def get(self, trial_app, message_id):
app_model = trial_app
app_mode = AppMode.value_of(app_model.mode)
@@ -470,7 +471,6 @@ class TrialCompletionApi(TrialAppResource):
class TrialSitApi(Resource):
"""Resource for trial app sites."""
@trial_feature_enable
@get_app_model_with_trial(None)
def get(self, app_model):
"""Retrieve app site info.
@@ -492,7 +492,6 @@ class TrialSitApi(Resource):
class TrialAppParameterApi(Resource):
"""Resource for app variables."""
@trial_feature_enable
@get_app_model_with_trial(None)
def get(self, app_model):
"""Retrieve app parameters."""
@@ -521,7 +520,6 @@ class TrialAppParameterApi(Resource):
class AppApi(Resource):
@trial_feature_enable
@get_app_model_with_trial(None)
@marshal_with(app_detail_with_site_model)
def get(self, app_model):
@@ -534,7 +532,6 @@ class AppApi(Resource):
class AppWorkflowApi(Resource):
@trial_feature_enable
@get_app_model_with_trial(None)
@marshal_with(workflow_model)
def get(self, app_model):
@@ -547,7 +544,6 @@ class AppWorkflowApi(Resource):
class DatasetListApi(Resource):
@trial_feature_enable
@get_app_model_with_trial(None)
def get(self, app_model):
page = request.args.get("page", default=1, type=int)
@@ -94,7 +94,7 @@ class TestTrialAppWorkflowRunApi:
with app.test_request_context("/"):
with pytest.raises(NotWorkflowAppError):
method(MagicMock(mode=AppMode.CHAT))
method(api, MagicMock(mode=AppMode.CHAT))
def test_success(self, app, trial_app_workflow, account):
api = module.TrialAppWorkflowRunApi()
@@ -106,7 +106,7 @@ class TestTrialAppWorkflowRunApi:
patch.object(module.AppGenerateService, "generate", return_value=MagicMock()),
patch.object(module.RecommendedAppService, "add_trial_app_record"),
):
result = method(trial_app_workflow)
result = method(api, trial_app_workflow)
assert result is not None
@@ -124,7 +124,7 @@ class TestTrialAppWorkflowRunApi:
),
):
with pytest.raises(ProviderNotInitializeError):
method(trial_app_workflow)
method(api, trial_app_workflow)
def test_workflow_quota_exceeded(self, app, trial_app_workflow, account):
api = module.TrialAppWorkflowRunApi()
@@ -140,7 +140,7 @@ class TestTrialAppWorkflowRunApi:
),
):
with pytest.raises(ProviderQuotaExceededError):
method(trial_app_workflow)
method(api, trial_app_workflow)
def test_workflow_model_not_support(self, app, trial_app_workflow, account):
api = module.TrialAppWorkflowRunApi()
@@ -156,7 +156,7 @@ class TestTrialAppWorkflowRunApi:
),
):
with pytest.raises(ProviderModelCurrentlyNotSupportError):
method(trial_app_workflow)
method(api, trial_app_workflow)
def test_workflow_invoke_error(self, app, trial_app_workflow, account):
api = module.TrialAppWorkflowRunApi()
@@ -172,7 +172,7 @@ class TestTrialAppWorkflowRunApi:
),
):
with pytest.raises(CompletionRequestError):
method(trial_app_workflow)
method(api, trial_app_workflow)
def test_workflow_rate_limit_error(self, app, trial_app_workflow, account):
api = module.TrialAppWorkflowRunApi()
@@ -188,7 +188,7 @@ class TestTrialAppWorkflowRunApi:
),
):
with pytest.raises(InvokeRateLimitHttpError):
method(trial_app_workflow)
method(api, trial_app_workflow)
def test_workflow_value_error(self, app, trial_app_workflow, account):
api = module.TrialAppWorkflowRunApi()
@@ -204,7 +204,7 @@ class TestTrialAppWorkflowRunApi:
),
):
with pytest.raises(ValueError):
method(trial_app_workflow)
method(api, trial_app_workflow)
def test_workflow_generic_exception(self, app, trial_app_workflow, account):
api = module.TrialAppWorkflowRunApi()
@@ -220,7 +220,7 @@ class TestTrialAppWorkflowRunApi:
),
):
with pytest.raises(InternalServerError):
method(trial_app_workflow)
method(api, trial_app_workflow)
class TestTrialChatApi:
@@ -566,7 +566,7 @@ class TestTrialMessageSuggestedQuestionApi:
with app.test_request_context("/"):
with pytest.raises(NotChatAppError):
method(api, MagicMock(mode="completion"), str(uuid4()))
method(MagicMock(mode="completion"), str(uuid4()))
def test_success(self, app, trial_app_chat, account):
api = module.TrialMessageSuggestedQuestionApi()
@@ -581,7 +581,7 @@ class TestTrialMessageSuggestedQuestionApi:
return_value=["q1", "q2"],
),
):
result = method(api, trial_app_chat, str(uuid4()))
result = method(trial_app_chat, str(uuid4()))
assert result == {"data": ["q1", "q2"]}
@@ -599,7 +599,7 @@ class TestTrialMessageSuggestedQuestionApi:
),
):
with pytest.raises(NotFound):
method(api, trial_app_chat, str(uuid4()))
method(trial_app_chat, str(uuid4()))
class TestTrialAppParameterApi:
@@ -931,7 +931,7 @@ class TestTrialAppWorkflowTaskStopApi:
with app.test_request_context("/"):
with pytest.raises(NotWorkflowAppError):
method(trial_app_chat, str(uuid4()))
method(api, trial_app_chat, str(uuid4()))
def test_success(self, app, trial_app_workflow, account):
api = module.TrialAppWorkflowTaskStopApi()
@@ -944,7 +944,7 @@ class TestTrialAppWorkflowTaskStopApi:
patch.object(module.AppQueueManager, "set_stop_flag_no_user_check") as mock_set_flag,
patch.object(module.GraphEngineManager, "send_stop_command") as mock_send_cmd,
):
result = method(trial_app_workflow, task_id)
result = method(api, trial_app_workflow, task_id)
assert result == {"result": "success"}
mock_set_flag.assert_called_once_with(task_id)