diff --git a/goodwe_controller/test_ev10.py b/goodwe_controller/test_ev10.py index bf79461..55af1cb 100644 --- a/goodwe_controller/test_ev10.py +++ b/goodwe_controller/test_ev10.py @@ -10,6 +10,7 @@ alarm decision (`car_explains`) has no hold. 3. EV-12: the add-on's own write, and Off within 15 s of it, is never "another writer"; a real outside change afterwards still shows the row. +Mutating a module this file grades? Read MUTATION.md first (purge __pycache__). """ import asyncio @@ -225,7 +226,7 @@ c11 = _Car(cover=False) o11 = over_run(c11, 1200, noisy) flips = sum(1 for a, b in zip(o11, o11[1:]) if a[0] != b[0]) check("while the car keeps the period at the limit the row stays on: one " - "switch on in 20 minutes, none off", flips == 1 and o11[-1][0] is True) + "switch on in 20 minutes, none off", flips == 1 and len(o11) == 1200 and o11[-1][0] is True) check("it turns on after the existing 10 s hold, not later than the first " "10 s the condition has stood (a gap does not restart the count)", next((i for i, x in enumerate(o11) if x[0]), 10**6) <= 25) @@ -253,13 +254,13 @@ check("a real end: the row stays for OVER_OFF_HOLD_S (180 s) and then goes", and not any(x[0] for x in o11e[off_at:])) o11r = over_run(c11e, 100, lambda t: 14500.0, t0=1000.0) check("it comes back after the usual 10 s if the condition returns after " - "it went", o11r[9][0] is False and o11r[10][0] is True) + "it went", len(o11r) == 100 and o11r[9][0] is False and o11r[10][0] is True) # the alarm decision has no hold: a real house overload is never delayed c11a = _Car(cover=True) o11a = over_run(c11a, 60, lambda t: 4300.0, target=4450.0) check("decision 1 on: the car explains it at once (no hold)", - o11a[0][1] is True) + len(o11a) == 60 and o11a[0][1] is True) c11a.w = None # the figure is not trusted c11a._now = 61.0 c11a.car_cycle(_Proj(4300.0), _G(True), 4450.0, None)