Files
fxhnt/tests/unit/test_equal_weights.py
2026-06-21 22:21:25 +02:00

11 lines
356 B
Python

from fxhnt.application.paper_book import equal_weights
def test_equal_weights_over_active_sleeves():
swb = {"a": {"X": 1.0}, "b": {"Y": -1.0}, "c": {}} # c is empty/inactive
assert equal_weights(swb) == {"a": 0.5, "b": 0.5} # 1/N over the 2 active; empties dropped
def test_equal_weights_empty():
assert equal_weights({"a": {}}) == {}