Skip to content

Commit 2ef2316

Browse files
committed
QPR-12253 update python test
1 parent e37822e commit 2ef2316

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

OREAnalytics-SWIG/Python/test/test_instruments.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,10 @@ def setUp(self):
338338
self.LIBOR_index = USDLibor(Period(3, Months), self.LIBOR_term_structure)
339339
self.OIS_spread = 0.005
340340
self.LIBOR_spread = 0.0
341+
self.spreadOnShort = True
341342
self.swap = OvernightIndexedBasisSwap(self.type, self.nominal, self.schedule,
342343
self.OIS_index, self.schedule, self.LIBOR_index,
343-
True, self.OIS_spread, self.LIBOR_spread)
344+
self.spreadOnShort, self.OIS_spread, self.LIBOR_spread)
344345
self.engine = DiscountingSwapEngine(self.OIS_term_structure)
345346
self.swap.setPricingEngine(self.engine)
346347

@@ -362,13 +363,13 @@ def testConsistency(self):
362363
fair_OIS_spread = self.swap.fairOvernightSpread()
363364
swap = OvernightIndexedBasisSwap(self.type, self.nominal, self.schedule,
364365
self.OIS_index, self.schedule, self.LIBOR_index,
365-
True, fair_OIS_spread, self.LIBOR_spread)
366+
self.spreadOnShort, fair_OIS_spread, self.LIBOR_spread)
366367
swap.setPricingEngine(self.engine)
367368
self.assertFalse(abs(swap.NPV()) > tolerance)
368369
fair_LIBOR_spread = self.swap.fairIborSpread()
369370
swap = OvernightIndexedBasisSwap(self.type, self.nominal, self.schedule,
370371
self.OIS_index, self.schedule, self.LIBOR_index,
371-
True, self.OIS_spread, fair_LIBOR_spread)
372+
self.spreadOnShort, self.OIS_spread, fair_LIBOR_spread)
372373
swap.setPricingEngine(self.engine)
373374
self.assertFalse(abs(swap.NPV()) > tolerance)
374375

@@ -650,6 +651,7 @@ def setUp(self):
650651
self.date_generation = DateGeneration.Forward
651652
self.end_of_month = False
652653
self.include_spread = False
654+
self.spreadOnShort = True
653655
self.sub_periods_type = SubPeriodsCoupon1.Compounding
654656
self.ois_term_structure = RelinkableYieldTermStructureHandle()
655657
self.short_index_term_structure = RelinkableYieldTermStructureHandle()
@@ -668,7 +670,7 @@ def setUp(self):
668670
self.long_index, self.long_index_leg_spread,
669671
self.short_index_schedule, self.short_index,
670672
self.short_index_leg_spread, self.include_spread,
671-
self.sub_periods_type)
673+
self.spreadOnShort, self.sub_periods_type)
672674
self.short_index_flat_forward = FlatForward(self.todays_date, 0.02, self.short_index.dayCounter())
673675
self.long_index_flat_forward = FlatForward(self.todays_date, 0.03, self.long_index.dayCounter())
674676
self.ois_flat_forward = FlatForward(self.todays_date, 0.01, self.day_counter)
@@ -703,7 +705,7 @@ def testConsistency(self):
703705
self.long_index, self.long_index_leg_spread,
704706
self.short_index_schedule, self.short_index,
705707
fair_short_leg_spread, self.include_spread,
706-
self.sub_periods_type)
708+
self.spreadOnShort, self.sub_periods_type)
707709
tenor_basis_swap.setPricingEngine(self.engine)
708710
self.assertFalse(abs(tenor_basis_swap.NPV()) > tolerance)
709711

0 commit comments

Comments
 (0)