Implementing tests for all Switzerland Cantons
* Moving Switzerland tests to their own module * All Cantons have associated tests: Aargau, Appenzell Innerrhoden, Appenzell Ausserrhoden, Bern, Basel-Landschaft, Basel-Stadt, Fribourg, Geneva, Glarus, Graubünden, Jura, Luzern, Neuchâtel, Nidwalden, Obwalden, St. Gallen, Schaffhausen, Solothurn, Schwyz, Thurgau, Ticino, Uri, Vaud, Valais, Zug, Zurich * Tests added for Switzerland ISO registry entries (+ subregions)
This commit is contained in:
parent
454fd081f4
commit
f0cfe9c6b2
|
@ -112,11 +112,7 @@ Europe
|
||||||
* Slovenia
|
* Slovenia
|
||||||
* Spain (incl. Catalonia)
|
* Spain (incl. Catalonia)
|
||||||
* Sweden
|
* Sweden
|
||||||
* Switzerland
|
* Switzerland (Aargau, Appenzell Innerrhoden, Appenzell Ausserrhoden, Bern, Basel-Landschaft, Basel-Stadt, Fribourg, Geneva, Glarus, Graubünden, Jura, Luzern, Neuchâtel, Nidwalden, Obwalden, St. Gallen, Schaffhausen, Solothurn, Schwyz, Thurgau, Ticino, Uri, Vaud, Valais, Zug, Zurich)
|
||||||
|
|
||||||
* Vaud
|
|
||||||
* Geneva
|
|
||||||
|
|
||||||
* Turkey
|
* Turkey
|
||||||
* Ukraine
|
* Ukraine
|
||||||
* United Kingdom (incl. Northern Ireland, Scotland and all its territories)
|
* United Kingdom (incl. Northern Ireland, Scotland and all its territories)
|
||||||
|
|
|
@ -55,24 +55,48 @@ Also, if you want those regions **and** their subregions, you can use the `inclu
|
||||||
|
|
||||||
```python
|
```python
|
||||||
>>> registry.get_calendars(['FR', 'CH', 'CA'], include_subregions=True)
|
>>> registry.get_calendars(['FR', 'CH', 'CA'], include_subregions=True)
|
||||||
{'CA': <class 'workalendar.america.canada.Canada'>,
|
{'FR': workalendar.europe.france.France,
|
||||||
'CA-AB': <class 'workalendar.america.canada.Alberta'>,
|
'CH': workalendar.europe.switzerland.Switzerland,
|
||||||
'CA-BC': <class 'workalendar.america.canada.BritishColumbia'>,
|
'CH-AG': workalendar.europe.switzerland.Aargau,
|
||||||
'CA-MB': <class 'workalendar.america.canada.Manitoba'>,
|
'CH-AI': workalendar.europe.switzerland.AppenzellInnerrhoden,
|
||||||
'CA-NB': <class 'workalendar.america.canada.NewBrunswick'>,
|
'CH-AR': workalendar.europe.switzerland.AppenzellAusserrhoden,
|
||||||
'CA-NL': <class 'workalendar.america.canada.Newfoundland'>,
|
'CH-BE': workalendar.europe.switzerland.Bern,
|
||||||
'CA-NS': <class 'workalendar.america.canada.NovaScotia'>,
|
'CH-BL': workalendar.europe.switzerland.BaselLandschaft,
|
||||||
'CA-NT': <class 'workalendar.america.canada.NorthwestTerritories'>,
|
'CH-BS': workalendar.europe.switzerland.BaselStadt,
|
||||||
'CA-NU': <class 'workalendar.america.canada.Nunavut'>,
|
'CH-FR': workalendar.europe.switzerland.Fribourg,
|
||||||
'CA-ON': <class 'workalendar.america.canada.Ontario'>,
|
'CH-GE': workalendar.europe.switzerland.Geneva,
|
||||||
'CA-PE': <class 'workalendar.america.canada.PrinceEdwardIsland'>,
|
'CH-GL': workalendar.europe.switzerland.Glarus,
|
||||||
'CA-QC': <class 'workalendar.america.canada.Quebec'>,
|
'CH-GR': workalendar.europe.switzerland.Graubunden,
|
||||||
'CA-SK': <class 'workalendar.america.canada.Saskatchewan'>,
|
'CH-JU': workalendar.europe.switzerland.Jura,
|
||||||
'CA-YT': <class 'workalendar.america.canada.Yukon'>,
|
'CH-LU': workalendar.europe.switzerland.Luzern,
|
||||||
'CH': <class 'workalendar.europe.switzerland.Switzerland'>,
|
'CH-NE': workalendar.europe.switzerland.Neuchatel,
|
||||||
'CH-VD': <class 'workalendar.europe.switzerland.Vaud'>,
|
'CH-NW': workalendar.europe.switzerland.Nidwalden,
|
||||||
'CH-GE': <class 'workalendar.europe.switzerland.Geneva'>,
|
'CH-OW': workalendar.europe.switzerland.Obwalden,
|
||||||
'FR': <class 'workalendar.europe.france.France'>}
|
'CH-SG': workalendar.europe.switzerland.StGallen,
|
||||||
|
'CH-SH': workalendar.europe.switzerland.Schaffhausen,
|
||||||
|
'CH-SO': workalendar.europe.switzerland.Solothurn,
|
||||||
|
'CH-SZ': workalendar.europe.switzerland.Schwyz,
|
||||||
|
'CH-TG': workalendar.europe.switzerland.Thurgau,
|
||||||
|
'CH-TI': workalendar.europe.switzerland.Ticino,
|
||||||
|
'CH-UR': workalendar.europe.switzerland.Uri,
|
||||||
|
'CH-VD': workalendar.europe.switzerland.Vaud,
|
||||||
|
'CH-VS': workalendar.europe.switzerland.Valais,
|
||||||
|
'CH-ZG': workalendar.europe.switzerland.Zug,
|
||||||
|
'CH-ZH': workalendar.europe.switzerland.Zurich,
|
||||||
|
'CA': workalendar.america.canada.Canada,
|
||||||
|
'CA-ON': workalendar.america.canada.Ontario,
|
||||||
|
'CA-QC': workalendar.america.canada.Quebec,
|
||||||
|
'CA-BC': workalendar.america.canada.BritishColumbia,
|
||||||
|
'CA-AB': workalendar.america.canada.Alberta,
|
||||||
|
'CA-SK': workalendar.america.canada.Saskatchewan,
|
||||||
|
'CA-MB': workalendar.america.canada.Manitoba,
|
||||||
|
'CA-NB': workalendar.america.canada.NewBrunswick,
|
||||||
|
'CA-NS': workalendar.america.canada.NovaScotia,
|
||||||
|
'CA-PE': workalendar.america.canada.PrinceEdwardIsland,
|
||||||
|
'CA-NL': workalendar.america.canada.Newfoundland,
|
||||||
|
'CA-YT': workalendar.america.canada.Yukon,
|
||||||
|
'CA-NT': workalendar.america.canada.NorthwestTerritories,
|
||||||
|
'CA-NU': workalendar.america.canada.Nunavut}
|
||||||
```
|
```
|
||||||
|
|
||||||
*Note*: if any of the codes is unknown, this function won't raise an error.
|
*Note*: if any of the codes is unknown, this function won't raise an error.
|
||||||
|
@ -92,11 +116,9 @@ Let's say that we only know the ISO code for Switzerland (`CH`). If we want to c
|
||||||
>>> calendar = CalendarClass()
|
>>> calendar = CalendarClass()
|
||||||
>>> calendar.holidays(2018)
|
>>> calendar.holidays(2018)
|
||||||
[(datetime.date(2018, 1, 1), 'New year'),
|
[(datetime.date(2018, 1, 1), 'New year'),
|
||||||
(datetime.date(2018, 1, 2), "Berchtold's Day"),
|
|
||||||
(datetime.date(2018, 3, 30), 'Good Friday'),
|
(datetime.date(2018, 3, 30), 'Good Friday'),
|
||||||
(datetime.date(2018, 4, 1), 'Easter Sunday'),
|
(datetime.date(2018, 4, 1), 'Easter Sunday'),
|
||||||
(datetime.date(2018, 4, 2), 'Easter Monday'),
|
(datetime.date(2018, 4, 2), 'Easter Monday'),
|
||||||
(datetime.date(2018, 5, 1), 'Labour Day'),
|
|
||||||
(datetime.date(2018, 5, 10), 'Ascension Thursday'),
|
(datetime.date(2018, 5, 10), 'Ascension Thursday'),
|
||||||
(datetime.date(2018, 5, 20), 'Whit Sunday'),
|
(datetime.date(2018, 5, 20), 'Whit Sunday'),
|
||||||
(datetime.date(2018, 5, 21), 'Whit Monday'),
|
(datetime.date(2018, 5, 21), 'Whit Monday'),
|
||||||
|
|
|
@ -56,8 +56,8 @@ from .scotland import (
|
||||||
from .switzerland import (
|
from .switzerland import (
|
||||||
Switzerland, Aargau, AppenzellInnerrhoden, AppenzellAusserrhoden, Bern,
|
Switzerland, Aargau, AppenzellInnerrhoden, AppenzellAusserrhoden, Bern,
|
||||||
BaselLandschaft, BaselStadt, Fribourg, Geneva, Glarus, Graubunden, Jura,
|
BaselLandschaft, BaselStadt, Fribourg, Geneva, Glarus, Graubunden, Jura,
|
||||||
Luzern, Neuchatel, Nidwalden, StGallen, Schaffhausen, Solothurn, Schwyz,
|
Luzern, Neuchatel, Nidwalden, Obwalden, StGallen, Schaffhausen, Solothurn,
|
||||||
Thurgau, Ticino, Uri, Vaud, Valais, Zug, Zurich
|
Schwyz, Thurgau, Ticino, Uri, Vaud, Valais, Zug, Zurich
|
||||||
)
|
)
|
||||||
|
|
||||||
__all__ = (
|
__all__ = (
|
||||||
|
@ -119,7 +119,7 @@ __all__ = (
|
||||||
'Switzerland',
|
'Switzerland',
|
||||||
'Aargau', 'AppenzellInnerrhoden', 'AppenzellAusserrhoden', 'Bern',
|
'Aargau', 'AppenzellInnerrhoden', 'AppenzellAusserrhoden', 'Bern',
|
||||||
'BaselLandschaft', 'BaselStadt', 'Fribourg', 'Geneva', 'Glarus',
|
'BaselLandschaft', 'BaselStadt', 'Fribourg', 'Geneva', 'Glarus',
|
||||||
'Graubunden', 'Jura', 'Luzern', 'Neuchatel', 'Nidwalden', 'StGallen',
|
'Graubunden', 'Jura', 'Luzern', 'Neuchatel', 'Nidwalden', 'Obwalden',
|
||||||
'Schaffhausen', 'Solothurn', 'Schwyz', 'Thurgau', 'Ticino', 'Uri', 'Vaud',
|
'StGallen', 'Schaffhausen', 'Solothurn', 'Schwyz', 'Thurgau', 'Ticino',
|
||||||
'Valais', 'Zug', 'Zurich',
|
'Uri', 'Vaud', 'Valais', 'Zug', 'Zurich',
|
||||||
)
|
)
|
||||||
|
|
|
@ -306,17 +306,15 @@ class Vaud(Switzerland):
|
||||||
|
|
||||||
def get_federal_thanksgiving_monday(self, year):
|
def get_federal_thanksgiving_monday(self, year):
|
||||||
"Monday following the 3rd sunday of September"
|
"Monday following the 3rd sunday of September"
|
||||||
september_1st = date(year, 9, 1)
|
third_sunday = self.get_nth_weekday_in_month(year, 9, SUN, 3)
|
||||||
return (
|
return (
|
||||||
september_1st +
|
third_sunday + timedelta(days=1),
|
||||||
(6 - september_1st.weekday()) * timedelta(days=1) + # 1st sunday
|
"Federal Thanksgiving Monday"
|
||||||
timedelta(days=15) # Monday following 3rd sunday
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_variable_days(self, year):
|
def get_variable_days(self, year):
|
||||||
days = super().get_variable_days(year)
|
days = super().get_variable_days(year)
|
||||||
days.append((self.get_federal_thanksgiving_monday(year),
|
days.append(self.get_federal_thanksgiving_monday(year))
|
||||||
"Federal Thanksgiving Monday"))
|
|
||||||
return days
|
return days
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,6 @@ from ..europe import (
|
||||||
Serbia,
|
Serbia,
|
||||||
Spain, Catalonia,
|
Spain, Catalonia,
|
||||||
Slovenia,
|
Slovenia,
|
||||||
Switzerland, Vaud, Geneva,
|
|
||||||
Ukraine,
|
Ukraine,
|
||||||
UnitedKingdom,
|
UnitedKingdom,
|
||||||
UnitedKingdomNorthernIreland,
|
UnitedKingdomNorthernIreland,
|
||||||
|
@ -1303,80 +1302,6 @@ class SloveniaTest(GenericCalendarTest):
|
||||||
self.assertIn(date(2017, 1, 2), holidays)
|
self.assertIn(date(2017, 1, 2), holidays)
|
||||||
|
|
||||||
|
|
||||||
class SwitzerlandTest(GenericCalendarTest):
|
|
||||||
cal_class = Switzerland
|
|
||||||
|
|
||||||
def test_year_2015(self):
|
|
||||||
holidays = self.cal.holidays_set(2015)
|
|
||||||
self.assertIn(date(2015, 1, 1), holidays)
|
|
||||||
self.assertIn(date(2015, 1, 2), holidays)
|
|
||||||
self.assertIn(date(2015, 4, 3), holidays)
|
|
||||||
self.assertIn(date(2015, 4, 5), holidays)
|
|
||||||
self.assertIn(date(2015, 4, 6), holidays)
|
|
||||||
self.assertIn(date(2015, 5, 1), holidays)
|
|
||||||
self.assertIn(date(2015, 5, 14), holidays)
|
|
||||||
self.assertIn(date(2015, 5, 24), holidays)
|
|
||||||
self.assertIn(date(2015, 5, 25), holidays)
|
|
||||||
self.assertIn(date(2015, 8, 1), holidays)
|
|
||||||
self.assertIn(date(2015, 12, 25), holidays)
|
|
||||||
self.assertIn(date(2015, 12, 26), holidays)
|
|
||||||
|
|
||||||
def test_year_2016(self):
|
|
||||||
holidays = self.cal.holidays_set(2016)
|
|
||||||
self.assertIn(date(2016, 1, 1), holidays)
|
|
||||||
self.assertIn(date(2016, 1, 2), holidays)
|
|
||||||
self.assertIn(date(2016, 3, 25), holidays)
|
|
||||||
self.assertIn(date(2016, 3, 28), holidays)
|
|
||||||
self.assertIn(date(2016, 5, 1), holidays)
|
|
||||||
self.assertIn(date(2016, 5, 5), holidays)
|
|
||||||
self.assertIn(date(2016, 5, 15), holidays)
|
|
||||||
self.assertIn(date(2016, 5, 16), holidays)
|
|
||||||
self.assertIn(date(2016, 8, 1), holidays)
|
|
||||||
self.assertIn(date(2016, 12, 25), holidays)
|
|
||||||
self.assertIn(date(2016, 12, 26), holidays)
|
|
||||||
|
|
||||||
|
|
||||||
class VaudTest(GenericCalendarTest):
|
|
||||||
cal_class = Vaud
|
|
||||||
|
|
||||||
def test_year_2016(self):
|
|
||||||
holidays = self.cal.holidays_set(2016)
|
|
||||||
self.assertIn(date(2016, 9, 19), holidays)
|
|
||||||
self.assertNotIn(date(2016, 5, 1), holidays)
|
|
||||||
self.assertNotIn(date(2016, 12, 26), holidays)
|
|
||||||
|
|
||||||
def test_year_2017(self):
|
|
||||||
holidays = self.cal.holidays_set(2017)
|
|
||||||
self.assertIn(date(2017, 9, 18), holidays)
|
|
||||||
self.assertNotIn(date(2017, 5, 1), holidays)
|
|
||||||
self.assertNotIn(date(2017, 12, 26), holidays)
|
|
||||||
|
|
||||||
|
|
||||||
class GenevaTest(GenericCalendarTest):
|
|
||||||
cal_class = Geneva
|
|
||||||
|
|
||||||
def test_year_2018(self):
|
|
||||||
holidays = self.cal.holidays_set(2018)
|
|
||||||
self.assertIn(date(2018, 9, 6), holidays)
|
|
||||||
self.assertIn(date(2018, 12, 31), holidays)
|
|
||||||
self.assertNotIn(date(2018, 5, 1), holidays)
|
|
||||||
self.assertNotIn(date(2018, 12, 26), holidays)
|
|
||||||
|
|
||||||
def test_year_2019(self):
|
|
||||||
holidays = self.cal.holidays_set(2019)
|
|
||||||
self.assertIn(date(2019, 9, 5), holidays)
|
|
||||||
self.assertIn(date(2019, 12, 31), holidays)
|
|
||||||
self.assertNotIn(date(2019, 5, 1), holidays)
|
|
||||||
self.assertNotIn(date(2019, 12, 26), holidays)
|
|
||||||
|
|
||||||
def test_year_2020(self):
|
|
||||||
holidays = self.cal.holidays_set(2020)
|
|
||||||
self.assertIn(date(2020, 9, 10), holidays)
|
|
||||||
self.assertIn(date(2020, 12, 31), holidays)
|
|
||||||
self.assertNotIn(date(2020, 5, 1), holidays)
|
|
||||||
self.assertNotIn(date(2020, 12, 26), holidays)
|
|
||||||
|
|
||||||
|
|
||||||
class EstoniaTest(GenericCalendarTest):
|
class EstoniaTest(GenericCalendarTest):
|
||||||
cal_class = Estonia
|
cal_class = Estonia
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,19 @@ from ..europe import (
|
||||||
Malta, Netherlands, Norway, Poland, Portugal, Romania, Russia, Slovakia,
|
Malta, Netherlands, Norway, Poland, Portugal, Romania, Russia, Slovakia,
|
||||||
Slovenia, Spain,
|
Slovenia, Spain,
|
||||||
# Catalonia, # TODO: Add it to registry
|
# Catalonia, # TODO: Add it to registry
|
||||||
Sweden, Switzerland, Vaud, Geneva, UnitedKingdom,
|
Sweden, UnitedKingdom,
|
||||||
UnitedKingdomNorthernIreland,
|
UnitedKingdomNorthernIreland,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Switzerland
|
||||||
|
from ..europe import (
|
||||||
|
Switzerland,
|
||||||
|
Aargau, AppenzellInnerrhoden, AppenzellAusserrhoden, Bern, BaselLandschaft,
|
||||||
|
BaselStadt, Fribourg, Geneva, Glarus, Graubunden, Jura, Luzern, Neuchatel,
|
||||||
|
Nidwalden, Obwalden, StGallen, Schaffhausen, Solothurn, Schwyz, Thurgau,
|
||||||
|
Ticino, Uri, Vaud, Valais, Zug, Zurich
|
||||||
|
)
|
||||||
|
|
||||||
# Germany
|
# Germany
|
||||||
from ..europe import (
|
from ..europe import (
|
||||||
Germany, BadenWurttemberg, Bavaria, Berlin, Brandenburg, Bremen,
|
Germany, BadenWurttemberg, Bavaria, Berlin, Brandenburg, Bremen,
|
||||||
|
@ -31,6 +40,13 @@ GERMANY_REGION_CLASSES = (
|
||||||
SaxonyAnhalt, SchleswigHolstein, Thuringia
|
SaxonyAnhalt, SchleswigHolstein, Thuringia
|
||||||
)
|
)
|
||||||
|
|
||||||
|
SWITZERLAND_REGION_CLASSES = (
|
||||||
|
Aargau, AppenzellInnerrhoden, AppenzellAusserrhoden, Bern, BaselLandschaft,
|
||||||
|
BaselStadt, Fribourg, Geneva, Glarus, Graubunden, Jura, Luzern, Neuchatel,
|
||||||
|
Nidwalden, Obwalden, StGallen, Schaffhausen, Solothurn, Schwyz, Thurgau,
|
||||||
|
Ticino, Uri, Vaud, Valais, Zug, Zurich
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class RegistryEurope(TestCase):
|
class RegistryEurope(TestCase):
|
||||||
def test_europe(self):
|
def test_europe(self):
|
||||||
|
@ -72,6 +88,8 @@ class RegistryEurope(TestCase):
|
||||||
self.assertIn(Germany, classes)
|
self.assertIn(Germany, classes)
|
||||||
for klass in GERMANY_REGION_CLASSES:
|
for klass in GERMANY_REGION_CLASSES:
|
||||||
self.assertIn(klass, classes)
|
self.assertIn(klass, classes)
|
||||||
|
for klass in SWITZERLAND_REGION_CLASSES:
|
||||||
|
self.assertIn(klass, classes)
|
||||||
|
|
||||||
def test_germany_subregion(self):
|
def test_germany_subregion(self):
|
||||||
# Get all the subregions
|
# Get all the subregions
|
||||||
|
@ -80,6 +98,13 @@ class RegistryEurope(TestCase):
|
||||||
for klass in GERMANY_REGION_CLASSES:
|
for klass in GERMANY_REGION_CLASSES:
|
||||||
self.assertIn(klass, classes)
|
self.assertIn(klass, classes)
|
||||||
|
|
||||||
|
def test_switzerland_subregion(self):
|
||||||
|
# Get all the subregions
|
||||||
|
classes = (v for k, v in registry.get_subregions('CH').items())
|
||||||
|
classes = list(classes)
|
||||||
|
for klass in SWITZERLAND_REGION_CLASSES:
|
||||||
|
self.assertIn(klass, classes)
|
||||||
|
|
||||||
def test_slovenia_code(self):
|
def test_slovenia_code(self):
|
||||||
# Source: https://github.com/peopledoc/workalendar/pull/291
|
# Source: https://github.com/peopledoc/workalendar/pull/291
|
||||||
self.assertEqual(registry.region_registry['SI'], Slovenia)
|
self.assertEqual(registry.region_registry['SI'], Slovenia)
|
||||||
|
|
|
@ -0,0 +1,879 @@
|
||||||
|
from datetime import date
|
||||||
|
|
||||||
|
from . import GenericCalendarTest
|
||||||
|
from ..europe import (
|
||||||
|
Aargau, AppenzellInnerrhoden, AppenzellAusserrhoden, Bern, BaselLandschaft,
|
||||||
|
BaselStadt, Fribourg, Geneva, Glarus, Graubunden, Jura, Luzern, Neuchatel,
|
||||||
|
Nidwalden, Obwalden, StGallen, Schaffhausen, Solothurn, Schwyz, Thurgau,
|
||||||
|
Ticino, Uri, Vaud, Valais, Zug, Zurich
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class AargauTest(GenericCalendarTest):
|
||||||
|
cal_class = Aargau
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 6, 11), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2020, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 6, 3), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2021, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
|
||||||
|
class AppenzellInnerrhodenTest(GenericCalendarTest):
|
||||||
|
cal_class = AppenzellInnerrhoden
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 6, 11), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2020, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2020, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 6, 3), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2021, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2021, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
|
||||||
|
class AppenzellAusserrhodenTest(GenericCalendarTest):
|
||||||
|
cal_class = AppenzellAusserrhoden
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
|
||||||
|
class BernTest(GenericCalendarTest):
|
||||||
|
cal_class = Bern
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
|
||||||
|
class BaselLandschaftTest(GenericCalendarTest):
|
||||||
|
cal_class = BaselLandschaft
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
|
||||||
|
class BaselStadtTest(GenericCalendarTest):
|
||||||
|
cal_class = BaselStadt
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
|
||||||
|
class FribourgTest(GenericCalendarTest):
|
||||||
|
cal_class = Fribourg
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 6, 11), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2020, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2020, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 6, 3), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2021, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2021, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
|
||||||
|
class GenevaTest(GenericCalendarTest):
|
||||||
|
cal_class = Geneva
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
# Jeune Genevois, only in Geneva
|
||||||
|
self.assertIn(date(2020, 9, 10), holidays)
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
# Restoration day - Geneva
|
||||||
|
self.assertIn(date(2020, 12, 31), holidays)
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
# Jeune Genevois, only in Geneva
|
||||||
|
self.assertIn(date(2021, 9, 9), holidays)
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
# Restoration day - Geneva
|
||||||
|
self.assertIn(date(2021, 12, 31), holidays)
|
||||||
|
|
||||||
|
|
||||||
|
class GlarusTest(GenericCalendarTest):
|
||||||
|
cal_class = Glarus
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 1, 2), holidays) # Berchtolds
|
||||||
|
# Only in Glarus/Glaris
|
||||||
|
self.assertIn(date(2020, 4, 3), holidays) # Näfels Day
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 1, 2), holidays) # Berchtolds
|
||||||
|
# Only in Glarus/Glaris
|
||||||
|
self.assertIn(date(2021, 4, 3), holidays) # Näfels Day
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
|
||||||
|
class GraubundenTest(GenericCalendarTest):
|
||||||
|
cal_class = Graubunden
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 1, 6), holidays) # Epiphany
|
||||||
|
self.assertIn(date(2020, 3, 19), holidays) # St Joseph
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 6, 11), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 1, 6), holidays) # Epiphany
|
||||||
|
self.assertIn(date(2021, 3, 19), holidays) # St Joseph
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 6, 3), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
|
||||||
|
class JuraTest(GenericCalendarTest):
|
||||||
|
cal_class = Jura
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 6, 11), holidays) # Corpus Christi
|
||||||
|
# Independance day - Only in Jura
|
||||||
|
self.assertIn(date(2020, 6, 23), holidays)
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2020, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 6, 3), holidays) # Corpus Christi
|
||||||
|
# Independance day - Only in Jura
|
||||||
|
self.assertIn(date(2021, 6, 23), holidays)
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2021, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
|
||||||
|
|
||||||
|
class LuzernTest(GenericCalendarTest):
|
||||||
|
cal_class = Luzern
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2020, 1, 6), holidays) # Epiphany
|
||||||
|
self.assertIn(date(2020, 3, 19), holidays) # St Joseph
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 6, 11), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2020, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2020, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2021, 1, 6), holidays) # Epiphany
|
||||||
|
self.assertIn(date(2021, 3, 19), holidays) # St Joseph
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 6, 3), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2021, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2021, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
|
||||||
|
class NeuchatelTest(GenericCalendarTest):
|
||||||
|
cal_class = Neuchatel
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2020, 3, 1), holidays) # Republic Day
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2021, 3, 1), holidays) # Republic Day
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
|
||||||
|
|
||||||
|
class NidwaldenTest(GenericCalendarTest):
|
||||||
|
cal_class = Nidwalden
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 3, 19), holidays) # St Joseph
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 6, 11), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2020, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2020, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 3, 19), holidays) # St Joseph
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 6, 3), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2021, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2021, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
|
||||||
|
class ObwaldenTest(GenericCalendarTest):
|
||||||
|
cal_class = Obwalden
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 6, 11), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2020, 9, 25), holidays) # Saint Nicholas of Flüe
|
||||||
|
self.assertIn(date(2020, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2020, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 6, 3), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2021, 9, 25), holidays) # Saint Nicholas of Flüe
|
||||||
|
self.assertIn(date(2021, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2021, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
|
||||||
|
class StGallenTest(GenericCalendarTest):
|
||||||
|
cal_class = StGallen
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
|
||||||
|
class SchaffhausenTest(GenericCalendarTest):
|
||||||
|
cal_class = Schaffhausen
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
|
||||||
|
class SolothurnTest(GenericCalendarTest):
|
||||||
|
cal_class = Solothurn
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2020, 3, 19), holidays) # St Joseph
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 6, 11), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2020, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2020, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2021, 3, 19), holidays) # St Joseph
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 6, 3), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2021, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2021, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
|
||||||
|
class SchwyzTest(GenericCalendarTest):
|
||||||
|
cal_class = Schwyz
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 1, 6), holidays) # Epiphany
|
||||||
|
self.assertIn(date(2020, 3, 19), holidays) # St Joseph
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 6, 11), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2020, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2020, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 1, 6), holidays) # Epiphany
|
||||||
|
self.assertIn(date(2021, 3, 19), holidays) # St Joseph
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 6, 3), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2021, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2021, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
|
||||||
|
class ThurgauTest(GenericCalendarTest):
|
||||||
|
cal_class = Thurgau
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
|
||||||
|
class TicinoTest(GenericCalendarTest):
|
||||||
|
cal_class = Ticino
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 1, 6), holidays) # Epiphany
|
||||||
|
self.assertIn(date(2020, 3, 19), holidays) # St Joseph
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 6, 11), holidays) # Corpus Christi
|
||||||
|
# St Peter & St Paul - Only in Ticino
|
||||||
|
self.assertIn(date(2020, 6, 29), holidays)
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2020, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2020, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 1, 6), holidays) # Epiphany
|
||||||
|
self.assertIn(date(2021, 3, 19), holidays) # St Joseph
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 6, 3), holidays) # Corpus Christi
|
||||||
|
# St Peter & St Paul - Only in Ticino
|
||||||
|
self.assertIn(date(2021, 6, 29), holidays)
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2021, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2021, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
|
||||||
|
class UriTest(GenericCalendarTest):
|
||||||
|
cal_class = Uri
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 1, 6), holidays) # Epiphany
|
||||||
|
self.assertIn(date(2020, 3, 19), holidays) # St Joseph
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 6, 11), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2020, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2020, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 1, 6), holidays) # Epiphany
|
||||||
|
self.assertIn(date(2021, 3, 19), holidays) # St Joseph
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 6, 3), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2021, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2021, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
|
||||||
|
class VaudTest(GenericCalendarTest):
|
||||||
|
cal_class = Vaud
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
# Lundi du Jeûne - Only in Vaud
|
||||||
|
self.assertIn(date(2020, 9, 21), holidays)
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
# Lundi du Jeûne - Only in Vaud
|
||||||
|
self.assertIn(date(2021, 9, 20), holidays)
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
|
||||||
|
|
||||||
|
class ValaisTest(GenericCalendarTest):
|
||||||
|
cal_class = Valais
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 3, 19), holidays) # St Joseph
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 11), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2020, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2020, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 3, 19), holidays) # St Joseph
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 6, 3), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2021, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2021, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
|
||||||
|
|
||||||
|
class ZugTest(GenericCalendarTest):
|
||||||
|
cal_class = Zug
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 6, 11), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2020, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2020, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 6, 3), holidays) # Corpus Christi
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 8, 15), holidays) # Assumption
|
||||||
|
self.assertIn(date(2021, 11, 1), holidays) # All Saints
|
||||||
|
self.assertIn(date(2021, 12, 8), holidays) # Immaculate conception
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
|
||||||
|
class ZurichTest(GenericCalendarTest):
|
||||||
|
cal_class = Zurich
|
||||||
|
|
||||||
|
def test_year_2020(self):
|
||||||
|
holidays = self.cal.holidays_set(2020)
|
||||||
|
self.assertIn(date(2020, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2020, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2020, 4, 10), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2020, 4, 13), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2020, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2020, 5, 21), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2020, 6, 1), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2020, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2020, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2020, 12, 26), holidays) # St Stephen's day
|
||||||
|
|
||||||
|
def test_year_2021(self):
|
||||||
|
holidays = self.cal.holidays_set(2021)
|
||||||
|
self.assertIn(date(2021, 1, 1), holidays) # New years day
|
||||||
|
self.assertIn(date(2021, 1, 2), holidays) # Berchtolds
|
||||||
|
self.assertIn(date(2021, 4, 2), holidays) # Good Friday
|
||||||
|
self.assertIn(date(2021, 4, 5), holidays) # Easter Monday
|
||||||
|
self.assertIn(date(2021, 5, 1), holidays) # Labour Day
|
||||||
|
self.assertIn(date(2021, 5, 13), holidays) # Ascension day
|
||||||
|
self.assertIn(date(2021, 5, 24), holidays) # Whit Monday
|
||||||
|
self.assertIn(date(2021, 8, 1), holidays) # Swiss National Day
|
||||||
|
self.assertIn(date(2021, 12, 25), holidays) # XMas
|
||||||
|
self.assertIn(date(2021, 12, 26), holidays) # St Stephen's day
|
Loading…
Reference in New Issue