Aggiunge notifier server per scheduler

This commit is contained in:
2026-07-01 12:56:27 +02:00
parent ad7265183c
commit 6232bb240c
7 changed files with 137 additions and 2 deletions

View File

@@ -0,0 +1,18 @@
from __future__ import annotations
from bakrest.server_check import ServerStatus
from bakrest.server_notifier import should_alert
def test_notifier_alerts_once_while_server_is_down() -> None:
status = ServerStatus(False, "now", "down")
assert should_alert(status, None)
assert not should_alert(status, "unreachable")
assert should_alert(status, "unreachable", always_alert=True)
def test_notifier_does_not_alert_when_server_is_reachable() -> None:
status = ServerStatus(True, "now", "ok")
assert not should_alert(status, None)