2 Commits
Author SHA1 Message Date
serversdownandClaude Opus 5.5 9a6bfa4d90 test: force-add the two Thor event fixtures the device-access tests read
tests/fixtures/ is gitignored, so these were never committed.  Since phase 1b
the test fakes read them, so on a fresh clone every test that builds a fake
Micromate -- phase 1a's included -- failed with FileNotFoundError.  Same
precedent as tests/fixtures/micromate-setup/: UM20147's own bench events.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-21 17:58:18 -04:00
serversdownandClaude Opus 5.5 a130107fdf fix(sfm): a Series-4 record whose timestamp did not decode is not called stale
Mirrors the Series-3 fix (F3): an unreadable 0C timestamp is a decode or
comms fault, not proof the unit was erased.  Nothing is downloaded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-21 17:58:18 -04:00
4 changed files with 15 additions and 0 deletions

No files matched your search

+4
View File
@@ -282,6 +282,10 @@ def s4_download_event(client: Any, serial: str, key: bytes, stamp: Optional[str]
if ref.key != key:
continue
found = stamp_of(ref.timestamp)
if stamp is not None and found is None:
raise MalformedReply(
f"could not read event {key.hex()}'s record (0C) timestamp to confirm it "
"is the one listed -- not downloaded; try again")
if stamp is not None and found != stamp:
raise StaleEvent(
f"the event at {key.hex()} on {serial} is from {found}, not {stamp} -- "
Binary file not shown.
Binary file not shown.
+11
View File
@@ -69,3 +69,14 @@ def test_a_stale_id_is_refused_and_nothing_is_downloaded():
def test_a_key_that_is_not_stored_is_404():
with pytest.raises(EventNotFound):
s4_download_event(FakeMicromateClient(), "UM20147", bytes.fromhex("deadbeef"), None)
def test_a_record_whose_timestamp_did_not_decode_is_not_called_stale():
# Mirrors Series 3 (F3): an unreadable 0C timestamp is a comms/decode fault,
# not proof the unit was erased -- and nothing is downloaded.
from sfm.device_access.errors import MalformedReply
fake = FakeMicromateClient()
fake.event_refs[0].timestamp = None
with pytest.raises(MalformedReply, match="0C"):
s4_download_event(fake, "UM20147", W_KEY, "20250531135901")
assert fake.fetched == []