mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-07 00:16:57 +08:00
fix: 修复运行时配置递归与插件兼容入口
This commit is contained in:
@@ -19,6 +19,7 @@ from app.application.configuration import (
|
||||
get_api_runtime_config_snapshot,
|
||||
get_transfer_retry_config,
|
||||
)
|
||||
from app.runtime.settings import RuntimeSettingsCompat, configure_runtime_settings_compat
|
||||
|
||||
|
||||
class _MutableSettings:
|
||||
@@ -62,6 +63,16 @@ def test_runtime_settings_service_hides_mutable_settings_implementation() -> Non
|
||||
assert service.get("VALUE") == "final"
|
||||
|
||||
|
||||
def test_runtime_settings_compat_delegates_to_concrete_service_backend() -> None:
|
||||
"""兼容 Settings 代理委托到真实设置对象时不会在 model_dump 中递归。"""
|
||||
service = RuntimeSettingsService(_MutableSettings())
|
||||
configure_runtime_settings_compat(service)
|
||||
|
||||
assert RuntimeSettingsCompat().model_dump(include={"VALUE"}) == {
|
||||
"VALUE": "before"
|
||||
}
|
||||
|
||||
|
||||
def test_system_config_service_supports_separate_reader_and_writer() -> None:
|
||||
"""应用服务可以分别注入只读与写入适配器。"""
|
||||
reader = MagicMock()
|
||||
|
||||
Reference in New Issue
Block a user