test: the Series-3 fake downloads a real event -- c32a9e7 was pushed with 4 tests failing

c32a9e7 made the download check read the 5A body; the Series-3 fake handed
back placeholder frames (['frame']), so 4 plumbing tests in
test_device_access_s3_events.py and test_device_access_event_dispatch.py
failed with "'str' object has no attribute 'data'" -- and that commit was
pushed without the failure set being read.  The fake's one-event download now
carries what a real one does: BE9441 event 1's recorded frames, their decoded
waveform and the unit's own peaks for it.  Those tests now see verified=True
on a whole event.  Suite back to the 16 known fixture failures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
This commit is contained in:
serversdownandClaude Opus 5.5 committed 2026-10-25 18:49:44 -04:00
1 parent c32a9e7851
commit a7214c50de
3 files changed
+27 -3

No files matched your search

+23
View File
@@ -148,11 +148,34 @@ class FakeMiniMateClient(_Base):
if expected_timestamp is not None and _iso(ev) != expected_timestamp:
ev = copy.copy(ev)
ev._a5_frames = None
elif ev._a5_frames:
_as_downloaded(ev)
self.last_download = ev
return ev
return None
_REAL = {}
def _as_downloaded(ev):
"""Give a fake event what a real one-event download carries: BE9441 event 1's
recorded A5 frames, their decoded waveform, and the unit's own 0C peaks for it
-- so the download check sees a whole, matching event."""
if not _REAL:
from minimateplus.framing import S3FrameParser
from minimateplus.waveform_codec import decode_a5_frames
raw = (Path(__file__).parent / "fixtures" / "minimate-bench-10-25-26"
/ "BE9441_event1_0111646a_rx.bin").read_bytes()
_REAL["frames"] = [f for f in S3FrameParser().feed(raw) if f.sub == 0xA5]
_REAL["samples"] = decode_a5_frames(_REAL["frames"])
ev._a5_frames = _REAL["frames"]
ev.raw_samples = _REAL["samples"]
pv = ev.peak_values
ev.peak_values = PeakValues(tran=0.030, vert=0.095, long=0.020, micl=pv.micl if pv else None,
peak_vector_sum=pv.peak_vector_sum if pv else None)
def s4_ref(index, key_hex, when, record_type, *, pvs=0.2):
"""Fixture-backed: the filename it produces names a real file in thor-idf/."""
ref = MicromateEventRef(index=index, key=bytes.fromhex(key_hex), size=0, serial="UM20147",