aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests
diff options
context:
space:
mode:
Diffstat (limited to 'python/tests')
-rw-r--r--python/tests/test_index.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/python/tests/test_index.py b/python/tests/test_index.py
index 67480719..a3abaaf8 100644
--- a/python/tests/test_index.py
+++ b/python/tests/test_index.py
@@ -41,6 +41,10 @@ class TestStrike(unittest.TestCase):
self.index.spread = 75
self.assertAlmostEqual(self.index.clean_pv, r[1])
+ def test_price_setting(self):
+ self.index.price = self.index.price
+ self.assertAlmostEqual(self.index.spread, 75)
+
class TestForwardIndex(unittest.TestCase):
index = Index.from_name("ig", 26, "5yr",
trade_date = datetime.date(2016, 7, 1))
@@ -56,7 +60,7 @@ class TestForwardIndex(unittest.TestCase):
(self.fi.index.fixed_rate - self.forward_spread) * 1e-4)
def test_forward_pv(self):
- """default adjusted forward price for trade_date equals clean pv """
+ """default adjusted forward price for trade_date equals clean pv"""
fi = ForwardIndex(self.index, self.index.trade_date)
self.assertAlmostEqual(fi.forward_pv, self.index.clean_pv / self.index.notional)