Skip to content

Commit

Permalink
PR suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
KJhellico committed Jan 2, 2025
1 parent 7541664 commit d14ec12
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
12 changes: 6 additions & 6 deletions tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,10 @@ def assertSundays(self, cls): # noqa: N802


class WorkingDaysTests(TestCase):
"""Common class to test countries with holidays substituted from non-working days."""
"""Common class for testing entity holidays substituted from non-working days."""

# Workday.
def _assertWorkday(self, instance_name, *args): # noqa: N802
def _assertWorkingDay(self, instance_name, *args): # noqa: N802
"""Helper: assert each date is a working day."""
holidays, dates = self._parse_arguments(args, instance_name=instance_name)
self._verify_type(holidays)
Expand All @@ -434,10 +434,10 @@ def _assertWorkday(self, instance_name, *args): # noqa: N802
self.assertTrue(holidays._is_weekend(parse(dt)))
self.assertTrue(holidays.is_working_day(dt))

def assertWorkday(self, *args): # noqa: N802
def assertWorkingDay(self, *args): # noqa: N802
"""Assert each date is a working day."""
self._assertWorkday("holidays", *args)
self._assertWorkingDay("holidays", *args)

def assertNonObservedWorkday(self, *args): # noqa: N802
def assertNonObservedWorkingDay(self, *args): # noqa: N802
"""Assert each date is a non-observed working day."""
self._assertWorkday("holidays_non_observed", *args)
self._assertWorkingDay("holidays_non_observed", *args)
4 changes: 2 additions & 2 deletions tests/countries/test_azerbaijan.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_substituted_holidays(self):
)

def test_workdays(self):
self.assertWorkday(
self.assertWorkingDay(
"2011-08-27",
"2012-12-29",
"2012-12-30",
Expand Down Expand Up @@ -110,7 +110,7 @@ def test_workdays(self):
2023: ("2023-12-30",),
2024: ("2024-12-29",),
}.items():
self.assertWorkday(Azerbaijan(years=year), dts)
self.assertWorkingDay(Azerbaijan(years=year), dts)

def test_new_years_day(self):
name = "Yeni il bayramı"
Expand Down
4 changes: 2 additions & 2 deletions tests/countries/test_belarus.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def test_substituted_holidays(self):
)

def test_workdays(self):
self.assertWorkday(
self.assertWorkingDay(
"1998-01-10",
"1998-04-25",
"1999-01-16",
Expand Down Expand Up @@ -429,7 +429,7 @@ def test_workdays(self):
"2006-12-30",
),
}.items():
self.assertWorkday(Belarus(years=year), dts)
self.assertWorkingDay(Belarus(years=year), dts)

def test_l10n_default(self):
self.assertLocalizedHolidays(
Expand Down
4 changes: 2 additions & 2 deletions tests/countries/test_china.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def test_substituted_holidays(self):
)

def test_workdays(self):
self.assertWorkday(
self.assertWorkingDay(
"2001-01-20",
"2001-01-21",
"2001-04-28",
Expand Down Expand Up @@ -402,7 +402,7 @@ def test_workdays(self):
"2011-12-31",
),
}.items():
self.assertWorkday(China(years=year), dts)
self.assertWorkingDay(China(years=year), dts)

def test_new_years_day(self):
self.assertHolidayName("元旦", (f"{year}-01-01" for year in range(1950, 2050)))
Expand Down
4 changes: 2 additions & 2 deletions tests/countries/test_kazakhstan.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def test_substituted_holidays(self):
)

def test_workdays(self):
self.assertWorkday(
self.assertWorkingDay(
"2000-05-06",
"2001-03-11",
"2001-03-25",
Expand Down Expand Up @@ -304,7 +304,7 @@ def test_workdays(self):
"2013-12-28",
),
}.items():
self.assertWorkday(Kazakhstan(years=year), dts)
self.assertWorkingDay(Kazakhstan(years=year), dts)

def test2022(self):
self.assertHolidays(
Expand Down
4 changes: 2 additions & 2 deletions tests/countries/test_taiwan.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_substituted_holidays(self):
)

def test_workdays(self):
self.assertWorkday(
self.assertWorkingDay(
"2010-02-06",
"2012-02-04",
"2012-03-03",
Expand Down Expand Up @@ -103,7 +103,7 @@ def test_workdays(self):
for year, dts in {
2014: ("2014-12-27",),
}.items():
self.assertWorkday(Taiwan(years=year), dts)
self.assertWorkingDay(Taiwan(years=year), dts)

def test_new_years_day(self):
name = "中華民國開國紀念日"
Expand Down
4 changes: 2 additions & 2 deletions tests/countries/test_ukraine.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def test_substituted_holidays(self):
)

def test_workdays(self):
self.assertWorkday(
self.assertWorkingDay(
"1991-05-05",
"1991-05-12",
"1991-07-13",
Expand Down Expand Up @@ -248,7 +248,7 @@ def test_workdays(self):
"1996-12-28",
),
}.items():
self.assertWorkday(Ukraine(years=year), dts)
self.assertWorkingDay(Ukraine(years=year), dts)

def test_new_year_day(self):
self.assertHoliday(f"{year}-01-01" for year in range(1991, 2023))
Expand Down
4 changes: 2 additions & 2 deletions tests/countries/test_vietnam.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def test_substituted_holidays(self):
)

def test_workdays(self):
self.assertWorkday(
self.assertWorkingDay(
"2010-02-27",
"2012-02-04",
"2013-05-04",
Expand All @@ -197,7 +197,7 @@ def test_workdays(self):
),
2019: ("2019-01-05",),
}.items():
self.assertWorkday(Vietnam(years=year), dts)
self.assertWorkingDay(Vietnam(years=year), dts)

def test_l10n_default(self):
self.assertLocalizedHolidays(
Expand Down

0 comments on commit d14ec12

Please sign in to comment.