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
+28
View File
@@ -1,5 +1,6 @@
from __future__ import annotations
import sys
from typing import Any
import httpx
@@ -21,6 +22,33 @@ from wf_transport_rpc_http.models import (
)
@pytest.fixture(autouse=True)
def _draft_enabled_composition(monkeypatch: pytest.MonkeyPatch) -> None:
"""Opt draft-focused RPC tests into the otherwise disabled composition."""
build_local = build_local_static_workflow_server
build_config = build_workflow_server_from_workflow_config
create_app = create_rpc_app
def draft_local(root, *args, **kwargs):
kwargs.setdefault("drafts", True)
return build_local(root, *args, **kwargs)
def draft_config(config, *args, **kwargs):
kwargs.setdefault("drafts", True)
return build_config(config, *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, "build_workflow_server_from_workflow_config", draft_config
)
monkeypatch.setattr(module, "create_rpc_app", draft_app)
async def _rpc(
client: httpx.AsyncClient, method: str, params: dict[str, Any]
) -> dict[str, Any]: