将根目录引擎迁入 chanlun/ 并保留兼容 shim;拆分 TF_DF 与 web 服务; 前端模块化;strategies 改用 chanlun 导入;补充 ESS 文档与 golden 回归。 Co-authored-by: Cursor <cursoragent@cursor.com>
47 lines
1.3 KiB
Python
47 lines
1.3 KiB
Python
"""Golden 回归:缠论流水线序列化结果应与基线一致。"""
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
def test_golden_pipeline():
|
|
r = subprocess.run(
|
|
[sys.executable, str(ROOT / "tests" / "generate_golden.py"), "--check"],
|
|
cwd=str(ROOT),
|
|
capture_output=True,
|
|
text=True,
|
|
)
|
|
assert r.returncode == 0, r.stdout + r.stderr
|
|
|
|
|
|
def test_package_imports():
|
|
from chanlun import ChanLun, TF_DF
|
|
from chanlun.core.ChanEnum import Chan_BI_DIR
|
|
|
|
assert ChanLun is not None and TF_DF is not None and Chan_BI_DIR is not None
|
|
|
|
|
|
def test_compat_shim_still_works():
|
|
"""根目录 shim 保留给外部旧脚本。"""
|
|
from ChanLun import ChanLun as C1
|
|
from TF_DF import TF_DF as T1
|
|
from ChanEnum import Chan_BI_DIR
|
|
from chanlun import ChanLun as C2, TF_DF as T2
|
|
|
|
assert C1 is C2 and T1 is T2 and Chan_BI_DIR is not None
|
|
|
|
|
|
def test_analyze_contract_keys_file():
|
|
keys = json.loads(
|
|
(ROOT / "tests" / "fixtures" / "analyze_contract_keys.json").read_text(
|
|
encoding="utf-8"
|
|
)
|
|
)
|
|
for k in ("kline_data", "bi_list", "seg_list", "zs_list", "bsp_list"):
|
|
assert k in keys
|