Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion financepy/products/credit/cds_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ def __repr__(self):
"""print out details of the CDS contract and all the calculated
cash flows"""
s = label_to_string("OBJECT TYPE", type(self).__name__)
s += label_to_string("EFFECTIVE DATE", self.step_in_dt)
s += label_to_string("EXPIRY DATE", self.expiry_dt)
s += label_to_string("TERMINATION DATE", self.maturity_dt)
s += label_to_string("STRIKE SPREAD", self.strike_cpn * 10000, "bp\n")
Expand Down
6 changes: 6 additions & 0 deletions tests/unit/test_cds_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ def test_cds_option_zero_volatility():
v0 = cds_option.value(value_dt, issuer_curve, 0.0)
v1 = cds_option.value(value_dt, issuer_curve, 1e-8)
assert round(v0, 6) == round(v1, 6)


def test_cds_option_repr():

cds_option = CDSOption(expiry_dt, maturity_dt, 0.015, notional)
assert "STRIKE SPREAD: 150.0bp" in repr(cds_option)
Loading