def test_first_tuesdays_2020(self): for m in month: seed_date = datetime.date(year=2020, month=m, day=1) date_of_second_tues = get_date_of(ordinal=ordinal.FIRST, day=calendar.TUESDAY, date=seed_date) d2 = self.first_tuesdays_2020[m - 1] d1 = date_of_second_tues.day self.assertEqual(d1, d2)
def test_fourth_tuesdays_2019(self): for m in month: seed_date = datetime.date(year=2019, month=m, day=1) date_of_fourth_tues = get_date_of(ordinal=ordinal.FOURTH, day=calendar.TUESDAY, date=seed_date) d2 = self.fourth_tuesdays_2019[m - 1] d1 = date_of_fourth_tues.day self.assertEqual(d1, d2)
def test_fifth_tuesdays_2019(self): for m in month: seed_date = datetime.date(year=2019, month=m, day=1) d2 = get_date_of(ordinal=ordinal.FIFTH, day=calendar.TUESDAY, date=seed_date) if d2: d2 = d2.day self.assertEqual(self.fifth_tuesdays_2019[m - 1], d2)
def test_third_tuesdays_2022(self): for m in month: seed_date = datetime.date(year=2022, month=m, day=1) date_of_third_tues = get_date_of(ordinal=ordinal.THIRD, day=calendar.TUESDAY, date=seed_date) d2 = self.third_tuesdays_2022[m - 1] d1 = date_of_third_tues.day self.assertEqual(d1, d2)
def test_second_tuesdays_2021(self): for m in month: seed_date = datetime.date(year=2021, month=m, day=1) date_of_second_tues = get_date_of(ordinal=ordinal.SECOND, day=calendar.TUESDAY, date=seed_date) d2 = self.second_tuesdays_2021[m - 1] d1 = date_of_second_tues.day self.assertEqual(d1, d2)
def test_third_sundays_2019(self): for m in month: seed_date = datetime.date(year=2019, month=m, day=1) date_of_third_sun = get_date_of(ordinal=ordinal.THIRD, day=calendar.SUNDAY, date=seed_date) d2 = self.third_sundays_2019[m - 1] d1 = date_of_third_sun.day self.assertEqual(d1, d2)
def test_fourth_sundays_2022(self): for m in month: seed_date = datetime.date(year=2022, month=m, day=1) date_of_fourth_sun = get_date_of(ordinal=ordinal.FOURTH, day=calendar.SUNDAY, date=seed_date) d2 = self.fourth_sundays_2022[m - 1] d1 = date_of_fourth_sun.day self.assertEqual(d1, d2)
def test_first_sundays_2021(self): for m in month: seed_date = datetime.date(year=2021, month=m, day=1) date_of_first_sun = get_date_of(ordinal=ordinal.FIRST, day=calendar.SUNDAY, date=seed_date) d2 = self.first_sundays_2021[m - 1] d1 = date_of_first_sun.day self.assertEqual(d1, d2)
def test_second_sundays_2020(self): for m in month: seed_date = datetime.date(year=2020, month=m, day=1) date_of_second_sun = get_date_of(ordinal=ordinal.SECOND, day=calendar.SUNDAY, date=seed_date) d2 = self.second_sundays_2020[m - 1] d1 = date_of_second_sun.day self.assertEqual(d1, d2)
def test_fifth_tuesdays_2022(self): for m in month: seed_date = datetime.date(year=2022, month=m, day=1) d2 = self.fifth_tuesdays_2022[m - 1] d1 = get_date_of(ordinal=ordinal.FIFTH, day=calendar.TUESDAY, date=seed_date) if d1: d1 = d1.day self.assertEqual(d1, d2)