Release v0.34.0 — Series-4 parity, and most of Blastware's report from the event file alone #59
No files matched your search
@@ -282,6 +282,10 @@ def s4_download_event(client: Any, serial: str, key: bytes, stamp: Optional[str]
|
|||||||
if ref.key != key:
|
if ref.key != key:
|
||||||
continue
|
continue
|
||||||
found = stamp_of(ref.timestamp)
|
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:
|
if stamp is not None and found != stamp:
|
||||||
raise StaleEvent(
|
raise StaleEvent(
|
||||||
f"the event at {key.hex()} on {serial} is from {found}, not {stamp} -- "
|
f"the event at {key.hex()} on {serial} is from {found}, not {stamp} -- "
|
||||||
|
|||||||
@@ -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():
|
def test_a_key_that_is_not_stored_is_404():
|
||||||
with pytest.raises(EventNotFound):
|
with pytest.raises(EventNotFound):
|
||||||
s4_download_event(FakeMicromateClient(), "UM20147", bytes.fromhex("deadbeef"), None)
|
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 == []
|
||||||
Reference in new issue
Block a user