mirror of
https://github.com/langgenius/dify.git
synced 2026-09-24 23:22:26 +08:00
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:
co-authored by
autofix-ci[bot]
Joel
parent
fb17339d89
commit
e3c2116501
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user