mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 23:47:41 +08:00
refactor: complete runtime configuration migration
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import asyncio
|
||||
from dataclasses import replace
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
from app.chain.search import SearchChain
|
||||
@@ -134,6 +135,10 @@ def test_music_search_matches_artist_from_resource_description():
|
||||
def test_music_stream_reports_site_progress_before_final_results(monkeypatch):
|
||||
"""精确音乐搜索应逐站点输出进度事件,不能等待全部搜索完成后才返回。"""
|
||||
chain = SearchChain()
|
||||
chain.runtime_config = replace(
|
||||
chain.runtime_config,
|
||||
search_multiple_name=False,
|
||||
)
|
||||
music = MusicInfo(
|
||||
media_source="musicbrainz",
|
||||
media_id="recording-1",
|
||||
@@ -194,8 +199,7 @@ def test_music_stream_reports_site_progress_before_final_results(monkeypatch):
|
||||
Mock(side_effect=AssertionError("音乐流式搜索不应回退到非流式站点搜索")),
|
||||
)
|
||||
|
||||
with patch("app.chain.search.settings.SEARCH_MULTIPLE_NAME", False):
|
||||
events = asyncio.run(collect_events())
|
||||
events = asyncio.run(collect_events())
|
||||
|
||||
assert [event["value"] for event in events[:2]] == [50, 100]
|
||||
assert [event["finished"] for event in events[:2]] == [1, 2]
|
||||
|
||||
Reference in New Issue
Block a user