aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests
diff options
context:
space:
mode:
Diffstat (limited to 'python/tests')
-rw-r--r--python/tests/test_dates.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/python/tests/test_dates.py b/python/tests/test_dates.py
index f0e81983..31d55322 100644
--- a/python/tests/test_dates.py
+++ b/python/tests/test_dates.py
@@ -9,6 +9,7 @@ from pyisda.date import (
cds_accrued as cds_accrued_c,
previous_twentieth,
)
+from pyisda.legs import FeeLeg
from serenitas.analytics.yieldcurve import get_curve
@@ -174,7 +175,7 @@ class TestCdsSchedule(unittest.TestCase):
self.yc = get_curve(self.trade_date, "USD")
def test_credit_schedule(self):
- """ tests when IMM date falls on a week-end"""
+ """tests when IMM date falls on a week-end"""
df = credit_schedule(self.trade_date, 1.0, self.yc, datetime.date(2022, 12, 20))
self.assertEqual(df.index[0], pd.Timestamp("2020-06-22"))
df = credit_schedule(
@@ -183,5 +184,20 @@ class TestCdsSchedule(unittest.TestCase):
self.assertEqual(df.index[0], pd.Timestamp("2020-06-22"))
+class TestHolidays(unittest.TestCase):
+ def setUp(self):
+ self.fl = FeeLeg(
+ datetime.date(2022, 3, 21),
+ datetime.date(2027, 12, 20),
+ True,
+ 1.0,
+ 1.0,
+ cal="/usr/share/cds/US",
+ )
+
+ def test_juneteenth(self):
+ self.assertEqual(self.fl.inspect()["pay_dates"][0], datetime.date(2022, 6, 21))
+
+
if __name__ == "__main__":
unittest.main()