fix: opt draft storage into real callers

This commit is contained in:
lda
2026-08-31 14:07:53 +07:00 Verified
parent ce7e3ed761
commit b377311a6e
21 changed files with 194 additions and 50 deletions
@@ -1,5 +1,6 @@
from __future__ import annotations
import sys
from typing import Any
import httpx
@@ -31,6 +32,25 @@ from wf_transport_rpc_http.client.drafts import RpcDraftClientMixin
from wf_transport_rpc_http.client.sources import RpcSourceAdminClientMixin
@pytest.fixture(autouse=True)
def _draft_enabled_composition(monkeypatch: pytest.MonkeyPatch) -> None:
"""Opt draft-focused RPC client tests into the explicit draft surface."""
build_local = build_local_static_workflow_server
create_app = create_rpc_app
def draft_local(root, *args, **kwargs):
kwargs.setdefault("drafts", True)
return build_local(root, *args, **kwargs)
def draft_app(server, *args, **kwargs):
kwargs.setdefault("drafts", True)
return create_app(server, *args, **kwargs)
module = sys.modules[__name__]
monkeypatch.setattr(module, "build_local_static_workflow_server", draft_local)
monkeypatch.setattr(module, "create_rpc_app", draft_app)
async def test_rpc_client_preserves_structured_jsonrpc_error() -> None:
def handler(request: httpx.Request) -> httpx.Response:
return httpx.Response(