RPF-WP-0046-T06: eso.token-renewal assurance signal; plan finished
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:
parent
8f7aa1bb77
commit
52224b84f8
5 changed files with 60 additions and 2 deletions
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue