16 lines
643 B
Python
16 lines
643 B
Python
"""The forward read-model DTOs and the state_reader that normalizes heterogeneous tracker state files."""
|
|
from __future__ import annotations
|
|
|
|
from fxhnt.application.forward_models import ForwardNavRow, ForwardSummary
|
|
|
|
|
|
def test_forward_summary_total_return_pct() -> None:
|
|
s = ForwardSummary(strategy_id="x", as_of="2026-06-12", days=7, nav=1.05,
|
|
total_return=0.05, sharpe=1.2, maxdd=-0.04)
|
|
assert round(s.total_return_pct, 2) == 5.0
|
|
|
|
|
|
def test_forward_nav_row_is_immutable() -> None:
|
|
r = ForwardNavRow(strategy_id="x", date="2026-06-05", ret=0.01, nav=1.01)
|
|
assert r.strategy_id == "x" and r.nav == 1.01
|