Skip to content

Commit

Permalink
Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
arkid15r committed Sep 16, 2024
1 parent effe3b0 commit 4ebd5b8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ repos:
hooks:
- id: bandit
additional_dependencies:
- .[toml]
- bandit[toml]
args:
- --configfile=pyproject.toml

Expand Down
7 changes: 5 additions & 2 deletions holidays/countries/united_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
- https://en.wikipedia.org/wiki/Indigenous_Peoples%27_Day_(United_States)
- https://www.sos.ri.gov/divisions/civics-and-education/reference-desk/ri-state-holidays
- https://web.archive.org/web/20080831103521/http://www.dpa.ca.gov/personnel-policies/holidays.htm
Frances Xavier Cabrini Day:
- https://leg.colorado.gov/sites/default/files/2020a_1031_signed.pdf
"""

country = "US"
Expand Down Expand Up @@ -324,9 +327,9 @@ def _populate_subdiv_co_public_holidays(self):
# Cesar Chavez Day
if self._year >= 2001:
self._add_holiday_mar_31("Cesar Chavez Day")

# Frances Xavier Cabrini Day
if self._year >= 2020:
# Frances Xavier Cabrini Day
# https://leg.colorado.gov/sites/default/files/2020a_1031_signed.pdf
self._add_holiday_1st_mon_of_oct("Frances Xavier Cabrini Day")

def _populate_subdiv_ct_public_holidays(self):
Expand Down
21 changes: 12 additions & 9 deletions tests/countries/test_united_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -1889,15 +1889,18 @@ def test_new_years_eve(self):
)

def test_frances_xavier_cabrini_day(self):
co_holidays = self.state_hols["CO"]
name = "Frances Xavier Cabrini Day"
self.assertNoHolidayName(name, self.state_hols["CO"], range(2000, 2019))
self.assertHolidayName(name, self.state_hols["CO"], range(2020, 2024))

dt = (
"2020-10-05",
"2021-10-04",
"2022-10-03",
"2023-10-02",
"2024-10-07",
self.assertNoHolidayName(name, co_holidays, range(2000, 2019))
self.assertHolidayName(name, co_holidays, range(2020, 2024))
self.assertHoliday(
co_holidays,
(
"2020-10-05",
"2021-10-04",
"2022-10-03",
"2023-10-02",
"2024-10-07",
),
)
self.assertHoliday(self.state_hols["CO"], dt)

0 comments on commit 4ebd5b8

Please sign in to comment.