File: test_malta.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 (126 lines) | stat: -rw-r--r-- 5,242 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
#  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.malta import Malta
from tests.common import CommonCountryTests


class TestMalta(CommonCountryTests, TestCase):
    @classmethod
    def setUpClass(cls):
        super().setUpClass(Malta)

    def test_1980(self):
        self.assertHolidaysInYear(
            1980,
            ("1980-01-01", "L-Ewwel tas-Sena"),
            ("1980-03-31", "Jum il-Ħelsien"),
            ("1980-04-04", "Il-Ġimgħa l-Kbira"),
            ("1980-05-01", "Jum il-Ħaddiem"),
            ("1980-08-15", "Il-Festa ta' Santa Marija"),
            ("1980-12-13", "Jum ir-Repubblika"),
            ("1980-12-25", "Il-Milied"),
        )

    def test_1987(self):
        self.assertHolidaysInYear(
            1987,
            ("1987-01-01", "L-Ewwel tas-Sena"),
            ("1987-02-10", "Il-Festa tan-Nawfraġju ta' San Pawl"),
            ("1987-03-19", "Il-Festa ta' San Ġużepp"),
            ("1987-04-17", "Il-Ġimgħa l-Kbira"),
            ("1987-05-01", "Jum il-Ħaddiem"),
            ("1987-06-29", "Il-Festa ta' San Pietru u San Pawl"),
            ("1987-08-15", "Il-Festa ta' Santa Marija"),
            ("1987-09-08", "Jum il-Vitorja"),
            ("1987-09-21", "Jum l-Indipendenza"),
            ("1987-12-08", "Il-Festa tal-Immakulata Kunċizzjoni"),
            ("1987-12-13", "Jum ir-Repubblika"),
            ("1987-12-25", "Il-Milied"),
        )

    def test_1989(self):
        self.assertHolidaysInYear(
            1989,
            ("1989-01-01", "L-Ewwel tas-Sena"),
            ("1989-02-10", "Il-Festa tan-Nawfraġju ta' San Pawl"),
            ("1989-03-19", "Il-Festa ta' San Ġużepp"),
            ("1989-03-24", "Il-Ġimgħa l-Kbira"),
            ("1989-03-31", "Jum il-Ħelsien"),
            ("1989-05-01", "Jum il-Ħaddiem"),
            ("1989-06-07", "Sette Giugno"),
            ("1989-06-29", "Il-Festa ta' San Pietru u San Pawl"),
            ("1989-08-15", "Il-Festa ta' Santa Marija"),
            ("1989-09-08", "Jum il-Vitorja"),
            ("1989-09-21", "Jum l-Indipendenza"),
            ("1989-12-08", "Il-Festa tal-Immakulata Kunċizzjoni"),
            ("1989-12-13", "Jum ir-Repubblika"),
            ("1989-12-25", "Il-Milied"),
        )

    def test_2022(self):
        self.assertHolidaysInYear(
            2022,
            ("2022-01-01", "L-Ewwel tas-Sena"),
            ("2022-02-10", "Il-Festa tan-Nawfraġju ta' San Pawl"),
            ("2022-03-19", "Il-Festa ta' San Ġużepp"),
            ("2022-03-31", "Jum il-Ħelsien"),
            ("2022-04-15", "Il-Ġimgħa l-Kbira"),
            ("2022-05-01", "Jum il-Ħaddiem"),
            ("2022-06-07", "Sette Giugno"),
            ("2022-06-29", "Il-Festa ta' San Pietru u San Pawl"),
            ("2022-08-15", "Il-Festa ta' Santa Marija"),
            ("2022-09-08", "Jum il-Vitorja"),
            ("2022-09-21", "Jum l-Indipendenza"),
            ("2022-12-08", "Il-Festa tal-Immakulata Kunċizzjoni"),
            ("2022-12-13", "Jum ir-Repubblika"),
            ("2022-12-25", "Il-Milied"),
        )

    def test_l10n_default(self):
        self.assertLocalizedHolidays(
            ("2023-01-01", "L-Ewwel tas-Sena"),
            ("2023-02-10", "Il-Festa tan-Nawfraġju ta' San Pawl"),
            ("2023-03-19", "Il-Festa ta' San Ġużepp"),
            ("2023-03-31", "Jum il-Ħelsien"),
            ("2023-04-07", "Il-Ġimgħa l-Kbira"),
            ("2023-05-01", "Jum il-Ħaddiem"),
            ("2023-06-07", "Sette Giugno"),
            ("2023-06-29", "Il-Festa ta' San Pietru u San Pawl"),
            ("2023-08-15", "Il-Festa ta' Santa Marija"),
            ("2023-09-08", "Jum il-Vitorja"),
            ("2023-09-21", "Jum l-Indipendenza"),
            ("2023-12-08", "Il-Festa tal-Immakulata Kunċizzjoni"),
            ("2023-12-13", "Jum ir-Repubblika"),
            ("2023-12-25", "Il-Milied"),
        )

    def test_l10n_en_us(self):
        self.assertLocalizedHolidays(
            "en_US",
            ("2023-01-01", "New Year's Day"),
            ("2023-02-10", "Feast of Saint Paul's Shipwreck"),
            ("2023-03-19", "Feast of Saint Joseph"),
            ("2023-03-31", "Freedom Day"),
            ("2023-04-07", "Good Friday"),
            ("2023-05-01", "Worker's Day"),
            ("2023-06-07", "Sette Giugno"),
            ("2023-06-29", "Feast of Saint Peter and Saint Paul"),
            ("2023-08-15", "Feast of the Assumption"),
            ("2023-09-08", "Feast of Our Lady of Victories"),
            ("2023-09-21", "Independence Day"),
            ("2023-12-08", "Feast of the Immaculate Conception"),
            ("2023-12-13", "Republic Day"),
            ("2023-12-25", "Christmas Day"),
        )