aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests/test_index.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/tests/test_index.py')
-rw-r--r--python/tests/test_index.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/python/tests/test_index.py b/python/tests/test_index.py
index d2b39dd2..5e09fe12 100644
--- a/python/tests/test_index.py
+++ b/python/tests/test_index.py
@@ -90,13 +90,18 @@ class TestForwardIndex(unittest.TestCase):
class TestIndexTrade(unittest.TestCase):
def test_traded_level(self):
trade = CreditIndex.from_tradeid(3436)
- dawndb = dbconn("dawndb")
- with dawndb.cursor() as c:
+ with trade._trade_conn.cursor() as c:
c.execute("SELECT traded_level FROM cds WHERE id=%s", (3436,))
(spread,) = c.fetchone()
- dawndb.commit()
self.assertAlmostEqual(trade.spread, float(spread))
+ def test_sofr_trade(self):
+ trade = CreditIndex.from_tradeid(3672)
+ with trade._trade_conn.cursor() as c:
+ c.execute("SELECT traded_level FROM cds WHERE id=%s", (3672,))
+ (spread,) = c.fetchone()
+ self.assertAlmostEqual(trade.spread, float(spread), 6)
+
if __name__ == "__main__":
unittest.main()