From 25f8dc595cee6d9ec48359a03f5674e749c02882 Mon Sep 17 00:00:00 2001 From: konstantin Date: Tue, 16 Jul 2024 09:26:27 +0200 Subject: [PATCH] feat: Add "Sonderfeiertag" `2025-04-04` https://www.bdew.de/media/documents/Feiertagskalender_GPKE-GeLiGas_2025_Version_1.0.pdf --- src/bdew_datetimes/calendar.py | 6 +++++- tests/test_calendar.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bdew_datetimes/calendar.py b/src/bdew_datetimes/calendar.py index 7792852..500aa0d 100644 --- a/src/bdew_datetimes/calendar.py +++ b/src/bdew_datetimes/calendar.py @@ -6,7 +6,7 @@ from datetime import date from holidays import HolidayBase, HolidaySum -from holidays.constants import DEC +from holidays.constants import APR, DEC from holidays.countries.germany import Germany @@ -27,6 +27,10 @@ def __init__(self, observed: bool = False, **kwargs): def _populate(self, year): self[date(year, DEC, 24)] = "Heiligabend" self[date(year, DEC, 31)] = "Silvester" + if year == 2025: + self[date(2025, APR, 4)] = ( + "Sonderfeiertag" # Anlässlich der Einführung des 24h Lieferantenwechsels + ) def create_bdew_calendar() -> HolidaySum: diff --git a/tests/test_calendar.py b/tests/test_calendar.py index 92951e4..2d97599 100644 --- a/tests/test_calendar.py +++ b/tests/test_calendar.py @@ -30,6 +30,7 @@ def test_bdew_holidays(expected_holiday: date): pytest.param(date(2024, 8, 15), True, id="Mariä Himmelfahrt (BY, SL)"), pytest.param(date(2024, 11, 20), True, id="Buß- und Bettag (SN)"), pytest.param(date(2024, 12, 31), True, id="Silvester 2024 (BDEW)"), + pytest.param(date(2025, 4, 4), True, id="Sonderfeiertag 2025 (BDEW)"), ], ) def test_create_bdew_calendar(test_date: date, expected_is_in_calendar: bool):