mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-23 00:03:07 +00:00
minor renamings
This commit is contained in:
parent
eef06ed131
commit
0fcae295ec
3 changed files with 11 additions and 15 deletions
|
@ -17,15 +17,15 @@ class Server(BaseModel):
|
|||
|
||||
# Tag, an dem der Kalender startet
|
||||
# TODO penner
|
||||
first_day: int = 1
|
||||
begin_day: int = 1
|
||||
|
||||
# Monat, in dem der Kalender startet
|
||||
# TODO penner
|
||||
month: int = 12
|
||||
begin_month: int = 12
|
||||
|
||||
# Alle Türen bleiben noch so viele Tage offen
|
||||
# Kalender so viele Tage nach der letzten Türöffnung schließen
|
||||
# TODO penner
|
||||
keep_open: int = 90
|
||||
close_after: int = 90
|
||||
|
||||
|
||||
class Puzzle(BaseModel):
|
||||
|
@ -35,10 +35,6 @@ class Puzzle(BaseModel):
|
|||
# Lösungswort
|
||||
solution: str
|
||||
|
||||
# Länge des Kalenders
|
||||
# TODO penner
|
||||
days: int = 24
|
||||
|
||||
# Kalenderdefinition
|
||||
calendar: str = "default.toml"
|
||||
|
||||
|
|
|
@ -116,10 +116,10 @@ class EventDates:
|
|||
# - assume sorted (ascending)
|
||||
events: list[int],
|
||||
# countdown to closing begins after last event
|
||||
closing_after: int,
|
||||
close_after: int,
|
||||
) -> None:
|
||||
# account for the last event, then add closing period
|
||||
self.__overall_duration = timedelta(days=events[-1] - 1 + closing_after)
|
||||
self.__overall_duration = timedelta(days=events[-1] - 1 + close_after)
|
||||
|
||||
# the events may begin last year, this year or next year
|
||||
maybe_begin = (
|
||||
|
|
|
@ -11,7 +11,7 @@ def test_get_before():
|
|||
begin_month=12,
|
||||
begin_day=1,
|
||||
events=list(range(1, 25)),
|
||||
closing_after=5,
|
||||
close_after=5,
|
||||
)
|
||||
|
||||
assert ed.first == date(2023, 12, 1)
|
||||
|
@ -28,7 +28,7 @@ def test_get_after():
|
|||
begin_month=12,
|
||||
begin_day=1,
|
||||
events=list(range(1, 25)),
|
||||
closing_after=5,
|
||||
close_after=5,
|
||||
)
|
||||
|
||||
assert ed.first == date(2024, 12, 1)
|
||||
|
@ -45,7 +45,7 @@ def test_get_during_events():
|
|||
begin_month=12,
|
||||
begin_day=1,
|
||||
events=list(range(1, 25)),
|
||||
closing_after=5,
|
||||
close_after=5,
|
||||
)
|
||||
|
||||
assert ed.first == date(2023, 12, 1)
|
||||
|
@ -62,7 +62,7 @@ def test_get_during_closing():
|
|||
begin_month=12,
|
||||
begin_day=1,
|
||||
events=list(range(1, 25)),
|
||||
closing_after=5,
|
||||
close_after=5,
|
||||
)
|
||||
|
||||
assert ed.first == date(2023, 12, 1)
|
||||
|
@ -79,7 +79,7 @@ def test_get_during_wrap():
|
|||
begin_month=12,
|
||||
begin_day=1,
|
||||
events=list(range(1, 25)),
|
||||
closing_after=8,
|
||||
close_after=8,
|
||||
)
|
||||
|
||||
assert ed.first == date(2023, 12, 1)
|
||||
|
|
Loading…
Reference in a new issue