Files
Chan/tests/test_tf_df_init.py
jackyu66gitandCursor df27b4dde8 refactor: ECR-002 拆分 runtime 包并加深 analyze 契约(已审)
将 web/services/runtime.py 拆为 runtime/ 子模块并保持门面兼容;补齐 ESS 文档、门面/契约/TF_DF 测试与 CODE_REVIEW Approve。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 18:15:23 +08:00

24 lines
695 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""ECR-002TF_DF 全量 __init__ 冒烟(CODE_REVIEW ECR-001 Finding 5)。"""
from __future__ import annotations
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT))
from tests.generate_golden import make_ohlcv # noqa: E402
def test_tf_df_full_init_smoke():
from chanlun import TF_DF
df = make_ohlcv(400)
# interval=1:不重采样,走完整 init_TF_DF 流水线
tf = TF_DF(df, interval=1, timeframe="5m")
assert tf is not None
assert len(getattr(tf, "klu_list", []) or []) > 0
assert hasattr(tf, "bi_list")
assert hasattr(tf, "seg_list")
assert getattr(tf, "chanmacd", None) is not None