后端: - 拆分出 agent_service, runtime_service, trading_service, news_service - Gateway 模块化拆分 (gateway_*.py) - 添加 domains/ 领域层 - 新增 control_client, runtime_client - 更新 start-dev.sh 支持 split 服务模式 前端: - 完善 API 服务层 (newsApi, tradingApi) - 更新 vite.config.js - Explain 组件优化 测试: - 添加多个服务 app 测试 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
28 lines
761 B
Python
28 lines
761 B
Python
# -*- coding: utf-8 -*-
|
|
"""Tests for the extracted agent service surface."""
|
|
|
|
from pathlib import Path
|
|
|
|
from fastapi.testclient import TestClient
|
|
|
|
from backend.apps.agent_service import create_app
|
|
|
|
|
|
def test_agent_service_routes_include_control_plane_endpoints(tmp_path):
|
|
app = create_app(project_root=tmp_path)
|
|
|
|
paths = {route.path for route in app.routes}
|
|
|
|
assert "/health" in paths
|
|
assert "/api/status" in paths
|
|
assert "/api/workspaces" in paths
|
|
assert "/api/guard/pending" in paths
|
|
|
|
|
|
def test_agent_service_excludes_runtime_routes(tmp_path):
|
|
app = create_app(project_root=tmp_path)
|
|
paths = {route.path for route in app.routes}
|
|
|
|
assert "/api/runtime/start" not in paths
|
|
assert "/api/runtime/gateway/port" not in paths
|