Skip to content

Commit

Permalink
Fix TestCase::_assertHolidayName and TestCase::_assertNoHolidayName m…
Browse files Browse the repository at this point in the history
…ethods
  • Loading branch information
KJhellico committed Jun 21, 2023
1 parent ceefae5 commit 2b0cd76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def _assertHolidayName(self, name, instance_name, *args):
self.assertTrue(set(items).issubset(holiday_years), name)
elif isinstance(arg, date) or parse(arg): # Exact date check.
for dt in items:
self.assertIn(dt, holidays, dt)
self.assertIn(name, holidays.get_list(dt), dt)
else:
raise ValueError(f"The {arg} wasn't caught by `assertHolidayName()`")

Expand Down Expand Up @@ -307,7 +307,7 @@ def _assertNoHolidayName(self, name, instance_name, *args):
self.assertEqual(0, len(holiday_years.intersection(items)), name)
elif isinstance(arg, date) or parse(arg): # Exact date check.
for dt in items:
self.assertNotIn(dt, holidays, dt)
self.assertNotIn(name, holidays.get_list(dt), dt)
else:
raise ValueError(f"The {arg} wasn't caught by `assertNoHolidayName()`")

Expand Down
2 changes: 1 addition & 1 deletion tests/countries/test_azerbaijan.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_republic_day(self):
self.assertHoliday(f"{year}-05-28" for year in range(1992, 2050))
self.assertNoHoliday(f"{year}-05-28" for year in range(1990, 1992))
self.assertHolidayName("Republic Day", (f"{year}-05-28" for year in range(1992, 2021)))
self.assertHolidayName("Independence Day", (f"{year}-05-28" for year in range(2001, 2021)))
self.assertHolidayName("Independence Day", (f"{year}-05-28" for year in range(2021, 2050)))

def test_salvation_day(self):
self.assertHoliday(f"{year}-06-15" for year in range(1997, 2050))
Expand Down

0 comments on commit 2b0cd76

Please sign in to comment.