Skip to content

Commit 5fa2c05

Browse files
committed
test: add regression tests for invalid cron_offset handling
1 parent cf7f6b0 commit 5fa2c05

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

tests/cli/scheduler/test_is_cron_task_now.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,21 @@ def test_is_cron_task_now(
7575
def test_is_cron_task_now_invalid_cron() -> None:
7676
with pytest.raises(CronValueError):
7777
is_cron_task_now("invalid cron", datetime.now())
78+
79+
80+
def test_is_cron_task_now_invalid_offset_string() -> None:
81+
with pytest.raises(CronValueError):
82+
is_cron_task_now(
83+
cron_value="* * * * *",
84+
now=datetime.now(timezone.utc),
85+
offset="UTC+3",
86+
)
87+
88+
89+
def test_is_cron_task_now_unknown_timezone_name() -> None:
90+
with pytest.raises(CronValueError):
91+
is_cron_task_now(
92+
cron_value="* * * * *",
93+
now=datetime.now(timezone.utc),
94+
offset="Europa/Madrid",
95+
)

0 commit comments

Comments
 (0)