test: lock down mcp model ownership shims

This commit is contained in:
lda
2026-06-06 15:07:02 +07:00 Verified
parent a28ca5434a
commit fa37f57c00
2 changed files with 19 additions and 0 deletions
+4
View File
@@ -371,6 +371,10 @@ implementation state.
and `sync_connections_from_config`. `WfMcpService.connections` remains a and `sync_connections_from_config`. `WfMcpService.connections` remains a
compatibility property while source hydration still belongs to compatibility property while source hydration still belongs to
`SourceCatalogService`. `SourceCatalogService`.
- MCP model ownership is being compartmentalized. `wf_mcp.broker.models` owns
broker/connection config dataclasses, `wf_mcp.catalog.models` owns catalog
snapshots, and `wf_mcp.auth` owns the legacy MCP auth record plus adapter
helpers. `wf_mcp.models` remains a compatibility facade for older imports.
- Several reusable implementation pieces still live in `wf_mcp` because they - Several reusable implementation pieces still live in `wf_mcp` because they
are MCP-shaped today (`source_registry.py`, `broker/server.py`, and focused are MCP-shaped today (`source_registry.py`, `broker/server.py`, and focused
`broker/service/*` services). The next config migration should make the `broker/service/*` services). The next config migration should make the
+15
View File
@@ -36,3 +36,18 @@ def test_concern_package_imports_resolve() -> None:
assert WfMcpService.__name__ == "WfMcpService" assert WfMcpService.__name__ == "WfMcpService"
assert ProxyRuntime.__name__ == "ProxyRuntime" assert ProxyRuntime.__name__ == "ProxyRuntime"
assert callable(load_broker_config) assert callable(load_broker_config)
def test_models_module_reexports_canonical_model_owners() -> None:
from wf_mcp.auth import AuthRecord
from wf_mcp.broker.models import BrokerConfig, ConnectionConfig
from wf_mcp.catalog.models import CatalogSnapshot
from wf_mcp.models import AuthRecord as CompatAuthRecord
from wf_mcp.models import BrokerConfig as CompatBrokerConfig
from wf_mcp.models import CatalogSnapshot as CompatCatalogSnapshot
from wf_mcp.models import ConnectionConfig as CompatConnectionConfig
assert CompatAuthRecord is AuthRecord
assert CompatBrokerConfig is BrokerConfig
assert CompatCatalogSnapshot is CatalogSnapshot
assert CompatConnectionConfig is ConnectionConfig