Status repeated the Monitors page's counts, check strip and uptime. Monitors now has one header row and every column Status had: the last 30 checks, latest response with its trend, uptime over 24h / 7d / 30d (the range picker goes) and TLS days on every row. /status and /status/rows and the nav link are removed outright; the dashboard Overview (/status/widget) stays and its Details link goes to Monitors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
933 B
Python
27 lines
933 B
Python
"""How long a monitor has been in its state (#5120). The Status page that
|
|
first showed it was folded into Monitors (#5270)."""
|
|
from datetime import datetime, timedelta, timezone
|
|
from types import SimpleNamespace
|
|
|
|
import pytest
|
|
|
|
from steward.core.status import streak_start
|
|
|
|
T0 = datetime(2026, 10, 6, 18, 0, tzinfo=timezone.utc)
|
|
|
|
|
|
def _checks(*ups):
|
|
return [SimpleNamespace(is_up=up, checked_at=T0 + timedelta(minutes=i)) for i, up in enumerate(ups)]
|
|
|
|
|
|
@pytest.mark.parametrize("ups, since, at_least", [
|
|
((), None, False),
|
|
((True,), 0, True),
|
|
((False, False, False), 0, True), # down for every check we have
|
|
((True, True, False, False), 2, False), # went down at the third check
|
|
((False, True, True, False), 3, False),
|
|
])
|
|
def test_streak_start(ups, since, at_least):
|
|
checks = _checks(*ups)
|
|
assert streak_start(checks) == ((checks[since].checked_at if since is not None else None), at_least)
|