RPF-WP-0046-T06: eso.token-renewal assurance signal; plan finished
Some checks are pending
CI Smoke / container-smoke (push) Waiting to run
CI Smoke / host-smoke (push) Successful in 0s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 150322@bnt-lap001
Assistant-Session: 16a7b788-374e-4915-a1df-fc87ffd9a5e4
This commit is contained in:
codex 2026-09-24 00:48:24 +02:00
parent 8f7aa1bb77
commit 52224b84f8
5 changed files with 60 additions and 2 deletions

View file

@ -166,3 +166,21 @@ class CollectorTests(unittest.TestCase):
if __name__ == '__main__':
unittest.main()
def test_eso_token_renewal_signal_classification():
import importlib.util
from datetime import datetime, timezone
from pathlib import Path
spec = importlib.util.spec_from_file_location(
'capture', Path(__file__).resolve().parents[1] / 'scripts/capture_service_observation.py')
capture = importlib.util.module_from_spec(spec)
spec.loader.exec_module(capture)
now = datetime(2026, 9, 25, 12, 0, tzinfo=timezone.utc)
assert capture.renewal_signal({}, now)[0] == 'unavailable'
ok = {'lastSuccessfulTime': '2026-09-25T02:40:09Z', 'lastScheduleTime': '2026-09-25T02:40:00Z'}
assert capture.renewal_signal(ok, now) == ('pass', '2026-09-25T02:40:09Z')
failed = {'lastSuccessfulTime': '2026-09-24T02:40:09Z', 'lastScheduleTime': '2026-09-25T02:40:00Z'}
assert capture.renewal_signal(failed, now) == ('fail', '2026-09-25T02:40:00Z')
running = {'lastSuccessfulTime': '2026-09-24T02:40:09Z', 'lastScheduleTime': '2026-09-25T11:30:00Z'}
assert capture.renewal_signal(running, now)[0] == 'pass'