Files
Chan/web/tests/test_analyze_contract.py
T
jackyu66gitandCursor 74dec4e50b refactor: 缠论引擎包化与 Web 分层(ECR-001)
将根目录引擎迁入 chanlun/ 并保留兼容 shim;拆分 TF_DF 与 web 服务;
前端模块化;strategies 改用 chanlun 导入;补充 ESS 文档与 golden 回归。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 18:48:20 +08:00

30 lines
754 B
Python

""" /api/analyze 契约冒烟:关键字段存在于契约清单。"""
from __future__ import annotations
import json
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
sys.path.insert(0, str(ROOT))
sys.path.insert(0, str(ROOT / "web"))
def test_analyze_route_registered():
from app import app
rules = {r.rule for r in app.url_map.iter_rules()}
assert "/api/analyze" in rules
assert "/api/chart_metadata" in rules
assert "/" in rules
assert "/chan_tv" in rules
def test_contract_keys_stable():
keys = json.loads(
(ROOT / "tests" / "fixtures" / "analyze_contract_keys.json").read_text(
encoding="utf-8"
)
)
assert "bi_list" in keys and "seg_list" in keys