Skip to content

Commit cf4a63f

Browse files
committed
test: add tests for VanguardDynamicSpending and CutWithdrawalsIfDrawdown
1 parent d619dbb commit cf4a63f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

tests/portfolio/conftest.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/portfolio/test_cashflow.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ def test_discount_rate_default_and_setter(pf_ab_monthly):
9595
assert pf_ab_monthly.dcf.discount_rate == pytest.approx(0.087, abs=1e-12)
9696

9797

98+
def test_indexation_strategy_default_indexation_when_no_inflation(pf_ab_monthly):
99+
assert not hasattr(pf_ab_monthly, "inflation")
100+
ind = ok.IndexationStrategy(pf_ab_monthly, indexation=None)
101+
assert ind.indexation == DEFAULT_DISCOUNT_RATE
102+
103+
98104
def test_wealth_index_fv_with_indexation(dcf_indexation_yearly):
99105
wi = dcf_indexation_yearly.wealth_index(discounting="fv", include_negative_values=False)
100106
# Shape sanity: wealth index is monthly over the available history
@@ -265,4 +271,3 @@ def test_plot_forecast_monte_carlo_smoke(dcf_indexation_yearly):
265271
dcf.mc.number = 5
266272
# Function returns None; this is a smoke test to ensure no exceptions are raised
267273
dcf.plot_forecast_monte_carlo(backtest=False)
268-

0 commit comments

Comments
 (0)