Skip to content

Commit

Permalink
[by] refractor out redundant workdays entry
Browse files Browse the repository at this point in the history
  • Loading branch information
PPsyrius committed Dec 26, 2024
1 parent 5472e25 commit e6f06c3
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 28 deletions.
2 changes: 1 addition & 1 deletion holidays/locale/be/LC_MESSAGES/BY.po
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.64\n"
"POT-Creation-Date: 2023-02-15 20:06-0800\n"
"PO-Revision-Date: 2024-12-25 14:08+0700\n"
"PO-Revision-Date: 2024-12-26 19:18+0700\n"
"Last-Translator: PPsyrius <ppsyrius@ppsyrius.dev>\n"
"Language-Team: Holidays Localization Team\n"
"Language: be\n"
Expand Down
2 changes: 1 addition & 1 deletion holidays/locale/en_US/LC_MESSAGES/BY.po
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.64\n"
"POT-Creation-Date: 2023-02-15 20:06-0800\n"
"PO-Revision-Date: 2024-12-25 14:08+0700\n"
"PO-Revision-Date: 2024-12-26 19:18+0700\n"
"Last-Translator: PPsyrius <ppsyrius@ppsyrius.dev>\n"
"Language-Team: Holidays Localization Team\n"
"Language: en_US\n"
Expand Down
2 changes: 1 addition & 1 deletion holidays/locale/ru/LC_MESSAGES/BY.po
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.64\n"
"POT-Creation-Date: 2024-12-24 11:39+0700\n"
"PO-Revision-Date: 2024-12-25 14:08+0700\n"
"PO-Revision-Date: 2024-12-26 19:18+0700\n"
"Last-Translator: PPsyrius <ppsyrius@ppsyrius.dev>\n"
"Language-Team: Holidays Localization Team\n"
"Language: ru\n"
Expand Down
2 changes: 1 addition & 1 deletion holidays/locale/th/LC_MESSAGES/BY.po
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.64\n"
"POT-Creation-Date: 2024-12-24 11:39+0700\n"
"PO-Revision-Date: 2024-12-25 14:08+0700\n"
"PO-Revision-Date: 2024-12-26 19:18+0700\n"
"Last-Translator: PPsyrius <ppsyrius@ppsyrius.dev>\n"
"Language-Team: Holidays Localization Team\n"
"Language: th\n"
Expand Down
52 changes: 28 additions & 24 deletions tests/countries/test_belarus.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
class TestBelarus(CommonCountryTests, TestCase):
@classmethod
def setUpClass(cls):
super().setUpClass(Belarus)
years = range(1991, 2050)
super().setUpClass(Belarus, years=years)
cls.workdays = Belarus(categories=WORKDAY, years=years)

def test_country_aliases(self):
self.assertAliases(Belarus, BY, BLR)
Expand Down Expand Up @@ -54,9 +56,10 @@ def test_public_2018(self):
def test_constitution_day(self):
name = "Дзень Канстытуцыі"

workdays = Belarus(categories=WORKDAY, years=range(1991, 2050))
self.assertHolidayName(name, workdays, (f"{year}-03-15" for year in range(1999, 2050)))
self.assertNoHolidayName(name, workdays, range(1991, 1995))
self.assertHolidayName(
name, self.workdays, (f"{year}-03-15" for year in range(1999, 2050))
)
self.assertNoHolidayName(name, self.workdays, range(1991, 1995))
self.assertHolidayName(name, (f"{year}-03-15" for year in range(1995, 1999)))
self.assertNoHolidayName(
name,
Expand All @@ -67,9 +70,10 @@ def test_constitution_day(self):
def test_day_of_unity_of_the_peoples_of_belarus_and_russia(self):
name = "Дзень яднання народаў Беларусі і Расіі"

workdays = Belarus(categories=WORKDAY, years=range(1991, 2050))
self.assertHolidayName(name, workdays, (f"{year}-04-02" for year in range(1996, 2050)))
self.assertNoHolidayName(name, workdays, range(1991, 1996))
self.assertHolidayName(
name, self.workdays, (f"{year}-04-02" for year in range(1996, 2050))
)
self.assertNoHolidayName(name, self.workdays, range(1991, 1996))
self.assertNoHolidayName(name)

def test_national_symbol_day(self):
Expand All @@ -96,9 +100,8 @@ def test_national_symbol_day(self):
"2029-05-13",
"2030-05-12",
)
workdays = Belarus(categories=WORKDAY, years=range(1991, 2050))
self.assertHolidayName(name, workdays, dt)
self.assertNoHolidayName(name, workdays, range(1991, 1998))
self.assertHolidayName(name, self.workdays, dt)
self.assertNoHolidayName(name, self.workdays, range(1991, 1998))
self.assertNoHolidayName(name)

def test_day_of_the_republic(self):
Expand All @@ -112,9 +115,10 @@ def test_day_of_the_republic(self):
def test_day_of_peoples_unity(self):
name = "Дзень народнага адзінства"

workdays = Belarus(categories=WORKDAY, years=range(1991, 2050))
self.assertHolidayName(name, workdays, (f"{year}-09-17" for year in range(2021, 2050)))
self.assertNoHolidayName(name, workdays, range(1991, 2021))
self.assertHolidayName(
name, self.workdays, (f"{year}-09-17" for year in range(2021, 2050))
)
self.assertNoHolidayName(name, self.workdays, range(1991, 2021))
self.assertNoHolidayName(name)

def test_new_years_day(self):
Expand All @@ -127,8 +131,9 @@ def test_new_years_day(self):
def test_day_of_fatherland_defenders(self):
name = "Дзень абаронцаў Айчыны і Узброеных Сіл Рэспублікі Беларусь"

workdays = Belarus(categories=WORKDAY, years=range(1991, 2050))
self.assertHolidayName(name, workdays, (f"{year}-02-23" for year in range(1991, 2050)))
self.assertHolidayName(
name, self.workdays, (f"{year}-02-23" for year in range(1991, 2050))
)
self.assertNoHolidayName(name)

def test_october_revolution_day(self):
Expand Down Expand Up @@ -162,9 +167,8 @@ def test_catholic_easter(self):
"2029-04-01",
"2030-04-21",
)
workdays = Belarus(categories=WORKDAY, years=range(1991, 2050))
self.assertHolidayName(name, workdays, dt)
self.assertNoHolidayName(name, workdays, range(1991, 1998))
self.assertHolidayName(name, self.workdays, dt)
self.assertNoHolidayName(name, self.workdays, range(1991, 1998))
self.assertNoHolidayName(name, 1991, range(1998, 2050))

def test_orthodox_easter(self):
Expand Down Expand Up @@ -192,9 +196,8 @@ def test_orthodox_easter(self):
"2029-04-08",
"2030-04-28",
)
workdays = Belarus(categories=WORKDAY, years=range(1991, 2050))
self.assertHolidayName(name, workdays, dt)
self.assertNoHolidayName(name, workdays, range(1991, 1998))
self.assertHolidayName(name, self.workdays, dt)
self.assertNoHolidayName(name, self.workdays, range(1991, 1998))
self.assertNoHolidayName(name, 1991, range(1998, 2050))

def test_radunitsa(self):
Expand Down Expand Up @@ -225,9 +228,10 @@ def test_radunitsa(self):
def test_dzyady(self):
name = "Дзень памяці"

workdays = Belarus(categories=WORKDAY, years=range(1991, 2050))
self.assertHolidayName(name, workdays, (f"{year}-11-02" for year in range(1998, 2050)))
self.assertNoHolidayName(name, workdays, range(1991, 1998))
self.assertHolidayName(
name, self.workdays, (f"{year}-11-02" for year in range(1998, 2050))
)
self.assertNoHolidayName(name, self.workdays, range(1991, 1998))
self.assertHolidayName(name, (f"{year}-11-02" for year in range(1992, 1998)))
self.assertNoHolidayName(name, 1991, range(1998, 2050))

Expand Down

0 comments on commit e6f06c3

Please sign in to comment.