mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 07:27:15 +08:00
refactor: 收口 V3 分层架构与插件兼容边界
This commit is contained in:
@@ -127,22 +127,16 @@ async def test_media_response_accepts_legacy_source_key() -> None:
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_media_exists_not_found_is_a_successful_query(monkeypatch) -> None:
|
||||
async def test_media_exists_not_found_is_a_successful_query() -> None:
|
||||
"""媒体库未命中是查询结果,不应被统一客户端识别为接口失败。"""
|
||||
|
||||
class EmptyMediaServerOper:
|
||||
class EmptyMediaServerQueryService:
|
||||
"""返回未命中的媒体库查询桩。"""
|
||||
|
||||
async def async_exists(self, **_kwargs):
|
||||
async def find_item_id(self, **_kwargs):
|
||||
"""模拟媒体库中不存在目标媒体。"""
|
||||
return None
|
||||
|
||||
monkeypatch.setattr(
|
||||
mediaserver_endpoint,
|
||||
"MediaServerOper",
|
||||
lambda _db: EmptyMediaServerOper(),
|
||||
)
|
||||
|
||||
response = await mediaserver_endpoint.exists_local(
|
||||
title="未入库电影",
|
||||
year="2026",
|
||||
@@ -150,7 +144,7 @@ async def test_media_exists_not_found_is_a_successful_query(monkeypatch) -> None
|
||||
media_source=None,
|
||||
media_id=None,
|
||||
season=None,
|
||||
db=object(),
|
||||
service=EmptyMediaServerQueryService(),
|
||||
_=None,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user