def test_julian_day_from_jalali_date(self): for y in range(303): for m in range(1, 13): for d in range(1, alg_c.get_days_in_jalali_month(y, m) + 1): self.assertEqual( alg_c.get_julian_day_from_jalali_date(y, m, d), alg_p.get_julian_day_from_jalali_date(y, m, d), "year: %s, month: %s, day: %s" % (y, m, d))
def test_days_in_month(self): for i in range(3000): for m in range(1, 13): c = alg_c.get_days_in_jalali_month(i, m) p = alg_p.get_days_in_jalali_month(i, m) self.assertEqual( c, p, "year: %s, month: %s, results: {c: %s, py: %s}" % (i, m, c, p))
def test_julian_day_from_jalali_date(self): for y in range(303): for m in range(1, 13): for d in range(1, alg_c.get_days_in_jalali_month(y, m)+1): self.assertEqual( alg_c.get_julian_day_from_jalali_date(y, m, d), alg_p.get_julian_day_from_jalali_date(y, m, d), "year: %s, month: %s, day: %s" % (y, m, d) )
def test_days_in_month(self): for i in range(3000): for m in range(1, 13): c = alg_c.get_days_in_jalali_month(i, m) p = alg_p.get_days_in_jalali_month(i, m) self.assertEqual(c, p, "year: %s, month: %s, results: {c: %s, py: %s}" % (i, m, c, p))