chore: clean up scheduling review diagnostics
This commit is contained in:
@@ -140,10 +140,9 @@ def test_candidate_is_at_most_one(tmp_path: Path) -> None:
|
||||
)
|
||||
store.save_candidate(first, schedule_id="a")
|
||||
store.save_candidate(second, schedule_id="a")
|
||||
assert store.get_candidate("a") is not None
|
||||
assert store.get_candidate("a").intended_at == datetime( # type: ignore[union-attr]
|
||||
2026, 9, 8, 13, 0, tzinfo=UTC
|
||||
)
|
||||
candidate = store.get_candidate("a")
|
||||
assert candidate is not None
|
||||
assert candidate.intended_at == datetime(2026, 9, 8, 13, 0, tzinfo=UTC)
|
||||
|
||||
|
||||
def test_history_pagination_over_resolved_utc(tmp_path: Path) -> None:
|
||||
@@ -163,12 +162,13 @@ def test_history_pagination_over_resolved_utc(tmp_path: Path) -> None:
|
||||
)
|
||||
page = store.list_occurrences("a", limit=2)
|
||||
assert page["total"] == 3
|
||||
assert page["next_cursor"] is not None
|
||||
assert "|" in str(page["next_cursor"])
|
||||
next_cursor = page["next_cursor"]
|
||||
assert isinstance(next_cursor, str)
|
||||
assert "|" in next_cursor
|
||||
assert len(page["occurrences"]) == 2 # type: ignore[arg-type]
|
||||
second = store.list_occurrences(
|
||||
"a",
|
||||
cursor=page["next_cursor"],
|
||||
cursor=next_cursor,
|
||||
limit=2, # type: ignore[arg-type]
|
||||
)
|
||||
assert second["next_cursor"] is None
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, cast
|
||||
|
||||
import pytest
|
||||
from pydantic import ValidationError
|
||||
|
||||
@@ -91,7 +93,7 @@ def test_update_schedule_params_match_create_numeric_constraints() -> None:
|
||||
)
|
||||
with pytest.raises(ValidationError):
|
||||
UpdateScheduleParams(
|
||||
schedule_id="schedule", expected_revision=1, max_steps="10"
|
||||
schedule_id="schedule", expected_revision=1, max_steps=cast(Any, "10")
|
||||
)
|
||||
|
||||
|
||||
@@ -101,11 +103,11 @@ def test_schedule_policy_params_reject_unknown_values() -> None:
|
||||
schedule_id="schedule",
|
||||
deployment_id="deployment",
|
||||
trigger={"kind": "oneshot", "at": "2026-09-08T12:00:00+00:00"},
|
||||
overlap="queue",
|
||||
overlap=cast(Any, "queue"),
|
||||
)
|
||||
with pytest.raises(ValidationError):
|
||||
UpdateScheduleParams(
|
||||
schedule_id="schedule", expected_revision=1, misfire="replay"
|
||||
schedule_id="schedule", expected_revision=1, misfire=cast(Any, "replay")
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user