EV-16 review round 2: pin the unread-SoC rule on the Why's live fallback
The fallback (no record yet, or a record of an ended episode) had no check; reading floor_limited alone there survived test_ev16. Test only. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -519,6 +519,19 @@ for t in range(0, 1200, 5):
|
||||
seq.append(kind(why(c)))
|
||||
check("T9 (long) guard None from the start for 1200 s: one text, 'full'",
|
||||
set(seq) == {"full"})
|
||||
# review round 2: the live fallback (no record yet, or one of an ended
|
||||
# episode) keeps the unread-SoC rule too
|
||||
for label, rec in (("no record yet", None),
|
||||
("a record of an ended episode", [True, None, -1])):
|
||||
c = S()
|
||||
c._now = 0.0
|
||||
c._car_why_rec = rec
|
||||
c.peak_guard = G(soc=None)
|
||||
check(f"N3 {label}: limited with SoC unread is not 'are at'",
|
||||
kind(why(c)) == "full")
|
||||
c.peak_guard = G()
|
||||
check(f"N3 {label}: limited with SoC read shows 'are at' (live state)",
|
||||
kind(why(c)) == "over")
|
||||
|
||||
print()
|
||||
print("FAIL: " + ", ".join(fails) if fails else "PASS: every check passed")
|
||||
|
||||
Reference in New Issue
Block a user