refactor: use explicit system config getter

This commit is contained in:
jxxghp
2026-08-24 04:04:35 +08:00
parent 4dd2d7fed2
commit 8555d0da3e
28 changed files with 111 additions and 76 deletions
@@ -1,5 +1,7 @@
"""Agent 资源流程工具权限测试。"""
# pylint: disable=no-name-in-module
import asyncio
import json
from types import SimpleNamespace
@@ -308,7 +310,7 @@ def test_query_downloaders_hides_sensitive_fields_for_non_admin_user():
]
with patch(
"app.agent.tools.impl.query_downloaders.SystemConfigOper"
"app.agent.tools.impl.query_downloaders.get_configured_system_config"
) as system_config_oper:
system_config_oper.return_value.get.return_value = downloaders
result = asyncio.run(tool.run())
@@ -345,7 +347,7 @@ def test_query_downloaders_keeps_full_fields_for_admin_context():
]
with patch(
"app.agent.tools.impl.query_downloaders.SystemConfigOper"
"app.agent.tools.impl.query_downloaders.get_configured_system_config"
) as system_config_oper:
system_config_oper.return_value.get.return_value = downloaders
result = asyncio.run(tool.run())