Skip to content

Commit

Permalink
IndexCurve depr updates
Browse files Browse the repository at this point in the history
  • Loading branch information
attack68 committed Dec 19, 2024
1 parent e713a7f commit ce5c368
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions python/tests/test_legs.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,34 @@ def test_zero_fixed_leg_cashflows(self, freq, cash, rate, curve) -> None:
rtol=1e-3,
)

def test_zero_fixed_leg_cashflows_cal(self, curve) -> None:
# assert stated cashflows accrual dates are adjusted according to calendar
# GH561/562
zfl = ZeroFixedLeg(
effective=dt(2024, 12, 15),
termination="5y",
payment_lag=0,
notional=-1e8,
convention="ActAct",
frequency="A",
rate=2.0,
)
result = zfl.cashflows(curve)
expected = DataFrame(
{
"Type": ["ZeroFixedLeg"],
"Acc Start": [dt(2024, 12, 16)],
"Acc End": [dt(2029, 12, 17)],
"DCF": [5.0],
"Rate": [2.0],
},
)
assert_frame_equal(
result[["Type", "Acc Start", "Acc End", "DCF", "Rate"]],
expected,
rtol=1e-3,
)

def test_zero_fixed_leg_npv(self, curve) -> None:
zfl = ZeroFixedLeg(
effective=dt(2022, 1, 1),
Expand Down

0 comments on commit ce5c368

Please sign in to comment.