feat(portfolio): portfolios.yml + load_active_portfolio (override operativi)

This commit is contained in:
2026-05-29 16:00:54 +02:00
parent 7a4bdb74f0
commit 169819fe31
3 changed files with 35 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
from src.portfolio.base import load_active_portfolio
def test_load_active_applies_overrides(tmp_path):
cfg = tmp_path / "portfolios.yml"
cfg.write_text("active: PORT06\noverrides:\n leverage: 2\n total_capital: 500\n")
p = load_active_portfolio(cfg)
assert p.code == "PORT06"
assert p.leverage == 2.0
assert p.total_capital == 500