mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 07:27:15 +08:00
refactor: use explicit system config getter
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user