feat(v2): complete v2 reimplementation

This commit is contained in:
2026-07-31 13:33:39 +02:00
parent 396219e776
commit bd107d6a30
137 changed files with 20737 additions and 155 deletions
+18
View File
@@ -0,0 +1,18 @@
from __future__ import annotations
from datetime import UTC, datetime
import pytest
from backup_tool.scheduler import ScheduleError, next_nominal
def test_five_field_cron_returns_utc_nominal_time() -> None:
result = next_nominal("0 9 * * *", "America/New_York", datetime(2026, 1, 1, tzinfo=UTC))
assert result.tzinfo is UTC
assert result.hour == 14
@pytest.mark.parametrize(("cron", "timezone"), [("* * * * * *", "UTC"), ("* * * * *", "Nope/Zone")])
def test_invalid_cron_or_timezone_is_rejected(cron: str, timezone: str) -> None:
with pytest.raises(ScheduleError):
next_nominal(cron, timezone)