mirror of https://github.com/langgenius/dify.git
fix: remove tool count limit test (limit check no longer exists)
This commit is contained in:
parent
1d0821d03f
commit
710b972199
|
|
@ -685,47 +685,3 @@ class TestApiToolManageService:
|
|||
schema="schema",
|
||||
)
|
||||
|
||||
def test_create_api_tool_provider_tool_count_exceeds_limit(
|
||||
self, flask_req_ctx_with_containers, db_session_with_containers: Session, mock_external_service_dependencies
|
||||
):
|
||||
"""Test creation raises ValueError when tool count exceeds limit."""
|
||||
fake = Faker()
|
||||
account, tenant = self._create_test_account_and_tenant(
|
||||
db_session_with_containers, mock_external_service_dependencies
|
||||
)
|
||||
|
||||
# Create a schema with many paths to exceed the 20-tool limit
|
||||
paths = {}
|
||||
for i in range(21):
|
||||
paths[f"/test{i}"] = {
|
||||
"get": {
|
||||
"operationId": f"testOp{i}",
|
||||
"summary": f"Test {i}",
|
||||
"responses": {"200": {"description": "Success"}},
|
||||
}
|
||||
}
|
||||
|
||||
import json
|
||||
|
||||
schema = json.dumps(
|
||||
{
|
||||
"openapi": "3.0.0",
|
||||
"info": {"title": "Test", "version": "1.0.0"},
|
||||
"servers": [{"url": "https://api.example.com"}],
|
||||
"paths": paths,
|
||||
}
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match="tools count exceeds the limit"):
|
||||
ApiToolManageService.create_api_tool_provider(
|
||||
user_id=account.id,
|
||||
tenant_id=tenant.id,
|
||||
provider_name=fake.unique.word(),
|
||||
icon={"content": "🔧", "background": "#FFF"},
|
||||
credentials={"auth_type": "none"},
|
||||
schema_type=ApiProviderSchemaType.OPENAPI,
|
||||
schema=schema,
|
||||
privacy_policy="",
|
||||
custom_disclaimer="",
|
||||
labels=[],
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue