refactor: 收口 V3 分层架构与插件兼容边界

This commit is contained in:
jxxghp
2026-08-18 13:22:02 +08:00
parent cca99bd421
commit 8472bcff43
274 changed files with 10730 additions and 6130 deletions
+4 -8
View File
@@ -14,13 +14,11 @@ def test_update_cookie_by_body_uses_request_body():
fake_chain.update_cookie.return_value = (True, "ok")
request = schemas.SiteCookieUpdate(username="user", password="password", code="123456")
with patch.object(site_endpoint.Site, "get", return_value=fake_site), patch.object(
site_endpoint, "SiteChain", return_value=fake_chain
):
with patch.object(site_endpoint, "SiteChain", return_value=fake_chain):
response = site_endpoint.update_cookie_by_body(
site_id=1,
site_cookie_update=request,
db=Mock(),
query=SimpleNamespace(get_sync=lambda _site_id: fake_site),
_=Mock(),
)
@@ -42,15 +40,13 @@ def test_update_cookie_legacy_get_keeps_query_params():
fake_chain = Mock()
fake_chain.update_cookie.return_value = (False, "failed")
with patch.object(site_endpoint.Site, "get", return_value=fake_site), patch.object(
site_endpoint, "SiteChain", return_value=fake_chain
):
with patch.object(site_endpoint, "SiteChain", return_value=fake_chain):
response = site_endpoint.update_cookie(
site_id=1,
username="user",
password="password",
code=None,
db=Mock(),
query=SimpleNamespace(get_sync=lambda _site_id: fake_site),
_=Mock(),
)