test(minimateplus): each strict-stream refusal has its own test; a re-poll always follows a SESSION_RESET

Review of 75d79ec / d73a27d (mutation): removing the chunk-timeout raise went
unnoticed because the TERM raise also said 'ended early', and the no-STRT,
metadata-page, mid-stream-terminator and chunk-cap raises had no test at all;
a re-poll without SESSION_RESET passed because the test double ignored it.
Each refusal is now pinned by its own message, each verified by removing it
(bytecode caching off -- same-second, same-size rewrites reuse a stale .pyc).
The strict tests use the shared replay helpers, which load either fixture.

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:52:23 -04:00
1 parent a7214c50de
commit 78617d47ce
3 files changed
+60 -50

No files matched your search

+5 -3
View File
@@ -10,16 +10,18 @@ from pathlib import Path
import minimateplus.protocol as mp
from minimateplus.framing import S3FrameParser
FIX = Path(__file__).parent / "fixtures" / "minimate-bench-10-25-26" / "BE9441_event1_0111646a_rx.bin"
_DIR = Path(__file__).parent / "fixtures" / "minimate-bench-10-25-26"
FIX = _DIR / "BE9441_event1_0111646a_rx.bin" # event 1 (non-first): no metadata pages
FIX_EVENT0 = _DIR / "BE9441_event0_01110000_rx.bin" # event 0: metadata pages 0x1002 / 0x1004
KEY = bytes.fromhex("0111646a")
STAMP = "2026-10-25T14:10:49"
UNIT_PEAKS = {"Tran": 0.030, "Vert": 0.095, "Long": 0.020} # the unit's own 0C peaks, in/s
SESSION_RESET = b"\x41\x03"
def recorded_replies():
def recorded_replies(path=None):
"""[(sub, raw_bytes)] for every frame of the session, in order."""
raw, out, start, p = FIX.read_bytes(), [], 0, S3FrameParser()
raw, out, start, p = (path or FIX).read_bytes(), [], 0, S3FrameParser()
for i in range(len(raw)):
for f in p.feed(raw[i:i + 1]):
out.append((f.sub, raw[start:i + 1]))