Exemplo n.º 1
0
 def test_bahai(self):
     self.reflexive(bahai.from_jd, bahai.to_jd)
     self.assertEqual(bahai.from_gregorian(1844, 3, 21), (1, 1, 1))
     self.assertEqual(bahai.to_gregorian(1, 1, 1), (1844, 3, 21))
     self.assertEqual(bahai.month_length(1, 3), 19)
     self.assertEqual(bahai.month_length(1, 1), 19)
     self.assertEqual(bahai.month_length(4, 19), 5)
     self.assertEqual(bahai.month_length(5, 19), 4)
     self.assertEqual(self.jd, bahai.to_jd(*bahai.from_jd(self.jd)))
Exemplo n.º 2
0
 def test_reflexive(self):
     for jd in range(2159677, 2488395, 1867):
         self.assertEqual(jd+0.5, bahai.to_jd(*bahai.from_jd(jd+0.5)))
Exemplo n.º 3
0
 def test_bahai(self):
     self.reflexive(bahai.from_jd, bahai.to_jd)
     self.assertEqual(bahai.month_length(1, 3), 19)
     self.assertEqual(bahai.month_length(1, 1), 19)
     self.assertEqual(self.jd, bahai.to_jd(*bahai.from_jd(self.jd)))