def test_tenor_of_week_fails_at_4(self): with self.assertRaises(PricingError) as error: Tenor.of_week(4) self.assertEqual("invalid weekly tenor of 4 weeks", str(error.exception))
def test_tenor_of_week(self): self.assertEqual(Tenor.IN_1_WEEK, Tenor.of_week(1)) self.assertEqual(Tenor.IN_2_WEEKS, Tenor.of_week(2)) self.assertEqual(Tenor.IN_3_WEEKS, Tenor.of_week(3))