Ejemplo n.º 1
0
 def test_2100(self):
     self.assertFalse(is_leap_year(2100))
Ejemplo n.º 2
0
 def test_2012(self):
     self.assertTrue(is_leap_year(2012))
Ejemplo n.º 3
0
 def test_2000(self):
     self.assertTrue(is_leap_year(2000))
Ejemplo n.º 4
0
 def test_2001(self):
     self.assertFalse(is_leap_year(2001))
Ejemplo n.º 5
0
 def test_invalid_day_for_february_not_leap_year(self):
     leap_years = [year for year in range(2000, 3000) if is_leap_year(year)]
     for year in [year for year in range(2000, 3000) if year not in leap_years]:
         with self.subTest(year=year):
             self.assertFalse(validate_day(year, 2, 29))
Ejemplo n.º 6
0
 def test_valid_day_for_february_in_leap_years(self):
     leap_years = [year for year in range(2000, 3000) if is_leap_year(year)]
     for day in range(1, 30):
         year = choice(leap_years)
         with self.subTest(day=day, year=year):
             self.assertTrue(validate_day(year, 2, day))