11 lines
356 B
Python
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": {}}) == {}
|