Ejemplo n.º 1
0
 def test_tenor_of_imm_month_fails_for_january(self):
     with self.assertRaises(PricingError) as error:
         Tenor.of_imm_month(1)
     self.assertEqual("invalid IMM monthly tenor for month 1",
                      str(error.exception))
     with self.assertRaises(PricingError) as error:
         Tenor.of_imm_month(2)
     self.assertEqual("invalid IMM monthly tenor for month 2",
                      str(error.exception))
     with self.assertRaises(PricingError) as error:
         Tenor.of_imm_month(11)
     self.assertEqual("invalid IMM monthly tenor for month 11",
                      str(error.exception))
Ejemplo n.º 2
0
 def test_tenor_of_imm_month(self):
     self.assertEqual(Tenor.IMM_MARCH, Tenor.of_imm_month(3))
     self.assertEqual(Tenor.IMM_JUNE, Tenor.of_imm_month(6))
     self.assertEqual(Tenor.IMM_SEPTEMBER, Tenor.of_imm_month(9))
     self.assertEqual(Tenor.IMM_DECEMBER, Tenor.of_imm_month(12))