Exemplo n.º 1
0
 def test_tenor_of_year_fails_at_6(self):
     with self.assertRaises(PricingError) as error:
         Tenor.of_year(6)
     self.assertEqual("invalid yearly tenor of 6 years",
                      str(error.exception))
Exemplo n.º 2
0
 def test_tenor_of_year(self):
     self.assertEqual(Tenor.IN_1_YEAR, Tenor.of_year(1))
     self.assertEqual(Tenor.IN_2_YEARS, Tenor.of_year(2))
     self.assertEqual(Tenor.IN_3_YEARS, Tenor.of_year(3))
     self.assertEqual(Tenor.IN_4_YEARS, Tenor.of_year(4))
     self.assertEqual(Tenor.IN_5_YEARS, Tenor.of_year(5))