Release v0.34.0 — Series-4 parity, and most of Blastware's report from the event file alone #59

Merged
serversdown merged 245 commits from dev into main 2026-11-04 18:19:24 -05:00
3 changed files with 27 additions and 3 deletions
Showing only changes of commit a7214c50de - Show all commits

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",
+1 -1
View File
@@ -61,7 +61,7 @@ def test_an_id_from_another_unit_is_refused_before_any_io():
def test_a_minimate_download_goes_through_the_series3_adapter():
dl = access(s3=[FakeMiniMateClient()]).download_event(ADDR, "BE18193", "BE18193:01110000:-")
assert dl.series == 3 and dl.a5_frames == ["frame"]
assert dl.series == 3 and dl.a5_frames and all(f.sub == 0xA5 for f in dl.a5_frames)
def test_a_ring_mid_download_releases_the_line_and_downloads_nothing():
+3 -2
View File
@@ -70,8 +70,9 @@ def test_listing_refuses_a_different_unit():
def test_download_returns_the_event_its_frames_and_the_settings():
fake = FakeMiniMateClient()
dl = adapter(fake).download_event(TCP, "BE18193", FIRST, "20261001080000")
assert (dl.series, dl.event_id, dl.verified) == (3, "BE18193:01110000:20261001080000", None)
assert dl.event is fake.events[0] and dl.a5_frames == ["frame"]
assert (dl.series, dl.event_id, dl.verified) == (3, "BE18193:01110000:20261001080000", True)
assert dl.event is fake.events[0] and dl.a5_frames is fake.events[0]._a5_frames
assert dl.a5_frames and all(f.sub == 0xA5 for f in dl.a5_frames)
assert dl.compliance is fake.compliance and dl.filename.startswith("T193")
assert dl.timestamp == datetime.datetime(2026, 10, 1, 8, 0, 0)