File: test_monaco.py

package info (click to toggle)
python-holidays 0.86-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 57,296 kB
  • sloc: python: 117,830; javascript: 85; makefile: 59
file content (184 lines) | stat: -rw-r--r-- 5,973 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
#  holidays
#  --------
#  A fast, efficient Python library for generating country, province and state
#  specific sets of holidays on the fly. It aims to make determining whether a
#  specific date is a holiday as fast and flexible as possible.
#
#  Authors: Vacanza Team and individual contributors (see CONTRIBUTORS file)
#           dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
#           ryanss <ryanssdev@icloud.com> (c) 2014-2017
#  Website: https://github.com/vacanza/holidays
#  License: MIT (see LICENSE file)

from unittest import TestCase

from holidays.countries.monaco import Monaco
from tests.common import CommonCountryTests


class TestMonaco(CommonCountryTests, TestCase):
    @classmethod
    def setUpClass(cls):
        super().setUpClass(Monaco)

    def test_immaculate_conception_day(self):
        self.assertHoliday(
            "2018-12-08",
            "2019-12-09",
            "2020-12-08",
            "2021-12-08",
            "2022-12-08",
            "2023-12-08",
            "2024-12-09",
        )

    def test_observed(self):
        observed_holidays = (
            "2010-08-16",
            "2011-05-02",
            "2011-12-26",
            "2012-01-02",
            "2015-11-02",
            "2016-05-02",
            "2016-12-26",
            "2017-01-02",
            "2017-11-20",
            "2020-11-02",
            "2021-08-16",
            "2022-05-02",
            "2022-12-26",
            "2023-01-02",
            "2023-11-20",
        )
        self.assertHoliday(observed_holidays)
        self.assertNoNonObservedHoliday(observed_holidays)

    def test_2020(self):
        self.assertHolidayDatesInYear(
            2020,
            "2020-01-01",
            "2020-01-27",
            "2020-04-13",
            "2020-05-01",
            "2020-05-21",
            "2020-06-01",
            "2020-06-11",
            "2020-08-15",
            "2020-11-01",
            "2020-11-02",
            "2020-11-19",
            "2020-12-08",
            "2020-12-25",
        )

    def test_2021(self):
        self.assertHolidayDatesInYear(
            2021,
            "2021-01-01",
            "2021-01-27",
            "2021-04-05",
            "2021-05-01",
            "2021-05-13",
            "2021-05-24",
            "2021-06-03",
            "2021-08-15",
            "2021-08-16",
            "2021-11-01",
            "2021-11-19",
            "2021-12-08",
            "2021-12-25",
        )

    def test_2022(self):
        self.assertHolidayDatesInYear(
            2022,
            "2022-01-01",
            "2022-01-27",
            "2022-04-18",
            "2022-05-01",
            "2022-05-02",
            "2022-05-26",
            "2022-06-06",
            "2022-06-16",
            "2022-08-15",
            "2022-11-01",
            "2022-11-19",
            "2022-12-08",
            "2022-12-25",
            "2022-12-26",
        )

    def test_2023(self):
        self.assertHolidayDatesInYear(
            2023,
            "2023-01-01",
            "2023-01-02",
            "2023-01-27",
            "2023-04-10",
            "2023-05-01",
            "2023-05-18",
            "2023-05-29",
            "2023-06-08",
            "2023-08-15",
            "2023-11-01",
            "2023-11-19",
            "2023-11-20",
            "2023-12-08",
            "2023-12-25",
        )

    def test_l10n_default(self):
        self.assertLocalizedHolidays(
            ("2022-01-01", "Le jour de l'An"),
            ("2022-01-27", "La Sainte Dévote"),
            ("2022-04-18", "Le lundi de Pâques"),
            ("2022-05-01", "Fête de la Travaille"),
            ("2022-05-02", "Fête de la Travaille (observé)"),
            ("2022-05-26", "L'Ascension"),
            ("2022-06-06", "Le lundi de Pentecôte"),
            ("2022-06-16", "La Fête Dieu"),
            ("2022-08-15", "L'Assomption de Marie"),
            ("2022-11-01", "La Toussaint"),
            ("2022-11-19", "La Fête du Prince"),
            ("2022-12-08", "L'Immaculée Conception"),
            ("2022-12-25", "Noël"),
            ("2022-12-26", "Noël (observé)"),
        )

    def test_l10n_en_us(self):
        self.assertLocalizedHolidays(
            "en_US",
            ("2022-01-01", "New Year's Day"),
            ("2022-01-27", "Saint Devote's Day"),
            ("2022-04-18", "Easter Monday"),
            ("2022-05-01", "Labor Day"),
            ("2022-05-02", "Labor Day (observed)"),
            ("2022-05-26", "Ascension Day"),
            ("2022-06-06", "Whit Monday"),
            ("2022-06-16", "Corpus Christi"),
            ("2022-08-15", "Assumption Day"),
            ("2022-11-01", "All Saints' Day"),
            ("2022-11-19", "Prince's Day"),
            ("2022-12-08", "Immaculate Conception"),
            ("2022-12-25", "Christmas Day"),
            ("2022-12-26", "Christmas Day (observed)"),
        )

    def test_l10n_uk(self):
        self.assertLocalizedHolidays(
            "uk",
            ("2022-01-01", "Новий рік"),
            ("2022-01-27", "День Святої Девоти"),
            ("2022-04-18", "Великодній понеділок"),
            ("2022-05-01", "День праці"),
            ("2022-05-02", "День праці (вихідний)"),
            ("2022-05-26", "Вознесіння Господнє"),
            ("2022-06-06", "День Святого Духа"),
            ("2022-06-16", "Свято Тіла і Крові Христових"),
            ("2022-08-15", "Внебовзяття Пресвятої Діви Марії"),
            ("2022-11-01", "День усіх святих"),
            ("2022-11-19", "День Князя"),
            ("2022-12-08", "Непорочне зачаття Діви Марії"),
            ("2022-12-25", "Різдво Христове"),
            ("2022-12-26", "Різдво Христове (вихідний)"),
        )