Special column applies only on non-rest days

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
rickzkmandClaude Sonnet 5.5 committed 2026-10-07 00:55:17 +02:00
1 parent 63a36333fb
commit 8649d3abd0
3 files changed
+22 -9

No files matched your search

+10 -3
View File
@@ -55,9 +55,16 @@ def test_special_column_ignored_on_other_days():
assert select_column([WORK_NEW, REST, SPECIAL], date(2026, 11, 2), rest_day=False) is WORK_NEW
def test_special_date_beats_rest_day():
# Default precedence (your call to change): a special date wins even on a rest day.
assert select_column([WORK_NEW, REST, SPECIAL], date(2026, 10, 29), rest_day=True) is SPECIAL
def test_special_date_is_ignored_on_a_rest_day():
# Decision: the special column is "Prac.dny-skolni prazdniny", i.e. workdays during
# school holidays only, so it never applies on a Saturday, Sunday or state holiday
# (rule set by the controller on 2026-10-07 after the final review).
assert select_column([WORK_NEW, REST, SPECIAL], date(2026, 10, 29), rest_day=True) is REST
def test_special_dates_on_a_saturday_use_the_rest_column():
special = col(KIND_SPECIAL, date(2026, 10, 29), [date(2026, 10, 29), date(2026, 10, 31)])
assert select_column([WORK_NEW, REST, special], date(2026, 10, 31), rest_day=True) is REST
def test_no_column_of_the_needed_kind_returns_none():