from fxhnt.application.paper_book import unit_shadow_positions


def test_builds_unit_notional_composition():
    swb = {"ts": {"BTCUSDT": 1.0}, "sc": {"USDTUSD": -1.0}}
    prices = {"BTCUSDT": 100.0, "USDTUSD": 1.0}
    out = unit_shadow_positions(swb, prices, "2026-01-01")
    by = {(p.sleeve, p.symbol): p for p in out}
    assert by[("ts", "BTCUSDT")].qty == 1.0 / 100.0      # w*1*1 / px
    assert by[("sc", "USDTUSD")].qty == -1.0 / 1.0
    assert all(p.entry_date == "2026-01-01" for p in out)
