From 57a9f56a64006450a788755480f1eec87b8b21b4 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Nov 2026 07:58:56 +0100 Subject: [PATCH] EV-13: guard the P4 live check's last sample (test_named_absence) Co-Authored-By: Claude --- goodwe_controller/test_ev13.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/goodwe_controller/test_ev13.py b/goodwe_controller/test_ev13.py index b0c57d6..98d2b29 100644 --- a/goodwe_controller/test_ev13.py +++ b/goodwe_controller/test_ev13.py @@ -1051,9 +1051,10 @@ for _s, _r in steady({5: dict(a=10.0)}, end=14, **zero): check("P4 [live]: from the send to the move the refusal is an open window " "dated TS (armed_at still None)", all(w == TS and a is None for s, w, a in _mid if s < 11)) +_last = _mid[-1] if _mid else None check(f"P4 [live]: the window arms dated TS when it runs out, and the moved " - f"read-back disarms it in the same sample ({_dates}, {_mid[-1]})", - _dates == [TS] and _tr.armed_at is None and not _tr.stuck_now + f"read-back disarms it in the same sample ({_dates}, {_last})", + _last is not None and _dates == [TS] and _tr.armed_at is None and not _tr.stuck_now and pend(_tr) is None) tr, first, ever = play(steady({5: dict(a=10.0)}, **zero), "ring", pre=zero) check(f"P4 [ring]: the read-back moved inside the window BEFORE the refusal "