Skip to content

Commit

Permalink
Added year 2020 test. Fixed wrong spelling. CCode cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
micodls committed Sep 10, 2021
1 parent 0987bb7 commit afa1c45
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ dist/
build/
.coverage
.tox/
Pipfile
Pipfile.lock
pyproject.toml
# py.test cache
.cache/
.pytest-cache/
Expand Down
3 changes: 0 additions & 3 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
- Added new badges (pypi, conda, license) and installation instructions (pip, conda) to readme file @sugatoray (#673).
- Replace `pyCalverter` with `convertdate` (#536)
- Remove unused `JalaliMixin`

## v15.5.0 (2021-07-18)

- New calendar: Added Philippines calendar by @micodls (#396)

## v15.4.0 (2021-07-12)
Expand Down
7 changes: 1 addition & 6 deletions workalendar/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class ChristianMixin:
ash_wednesday_label = "Ash Wednesday"
include_palm_sunday = False
include_holy_thursday = False
holy_thursday_label = "Holy Thurssaday"
holy_thursday_label = "Holy Thursday"
include_good_friday = False
good_friday_label = "Good Friday"
include_easter_monday = False
Expand Down Expand Up @@ -1025,11 +1025,6 @@ def get_fixed_holidays(self, year):
days.append((date(year, 5, 1), self.labour_day_label))
return days

if self.include_islamic_new_year:
days.append((1, 1, "Islamic New Year"))
if self.include_prophet_birthday:
days.append((3, 12, "Prophet's Birthday"))

def get_variable_days(self, year):
days = super().get_variable_days(year)
new_year = date(year, 1, 1)
Expand Down
25 changes: 25 additions & 0 deletions workalendar/tests/test_asia.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,3 +818,28 @@ def test_year_2021(self):
self.assertIn(date(2021, 12, 25), holidays) # Christmas Day
self.assertIn(date(2021, 12, 30), holidays) # Rizal Day
self.assertIn(date(2021, 12, 31), holidays) # New Year's Eve

def test_year_2020(self):
holidays = self.cal.holidays_set(2020)
self.assertIn(date(2020, 1, 1), holidays) # New Year
self.assertIn(date(2020, 1, 25), holidays) # Chinese New Year
self.assertIn(date(2020, 2, 25), holidays) # EDSA Revolution
self.assertIn(date(2020, 4, 9), holidays) # Araw ng Kagitingan
self.assertIn(date(2020, 4, 9), holidays) # Maundy Thursday
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
self.assertIn(date(2020, 4, 11), holidays) # Black Saturday
self.assertIn(date(2020, 4, 12), holidays) # Easter Sunday
self.assertIn(date(2020, 5, 1), holidays) # Labor Day
self.assertIn(date(2020, 5, 24), holidays) # Eid'l Fitr
self.assertIn(date(2020, 6, 12), holidays) # Independence Day
self.assertIn(date(2020, 7, 31), holidays) # Eid'l Adha
self.assertIn(date(2020, 8, 21), holidays) # Ninoy Aquino Day
self.assertIn(date(2020, 8, 30), holidays) # National Heroes' Day
self.assertIn(date(2020, 11, 1), holidays) # All Saints' Day
self.assertIn(date(2020, 11, 2), holidays) # All Souls Day
self.assertIn(date(2020, 11, 30), holidays) # Bonifacio Day
self.assertIn(date(2020, 12, 8), holidays) # Immaculate Conception
self.assertIn(date(2020, 12, 24), holidays) # Christmas Eve
self.assertIn(date(2020, 12, 25), holidays) # Christmas Day
self.assertIn(date(2020, 12, 30), holidays) # Rizal Day
self.assertIn(date(2020, 12, 31), holidays) # New Year's Eve

0 comments on commit afa1c45

Please sign in to comment.