Files
test/backend/tests
Le 06bc5ba29b test: them 40 pytest cho indicator_service.py + phan async cua signal_service.py
- test_indicator_service.py (33 test): sma, ema, rsi, bollinger_bands,
  macd, atr, vwap, obv, obv_signal, mfi, detect_market_regime. Phat hien
  2 quirk nho (chua fix, can quyet dinh cua team):
    (q) rsi() tra ~98 thay vi 50 khi gia hoan toan di ngang (rs=50 sentinel
        van bi dua qua cong thuc RSI thay vi tra thang 50)
    (r) mfi() bi wraparound index o diem tinh dau tien cua chuoi (j-1=-1),
        tac dong thuc te gan bang 0 vi signal_service chi doc mfi_data[-1]
- test_signal_service_async.py (7 test): close_stale_trades (time limit,
  stop loss, take profit, trailing stop) + expire_old_signals. Cac ham
  nay tu mo session rieng qua async_session_factory (khong nhan db lam
  tham so) nen test monkeypatch bien module-level nay sang SQLite in-memory.
- conftest.py: them fixture session_factory (async_sessionmaker thay vi 1
  session) + _UTCDateTime TypeDecorator de SQLite giu duoc tzinfo UTC qua
  round-trip (SQLite khong ho tro luu tz-aware datetime nhu Postgres).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-03 22:30:31 +07:00
..