- # test the cleanup of null bytes
- monkeypatch.setattr(
- "rmr.rmr.get_meid",
- lambda _: "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
- )
- sbuf = rmr.rmr_alloc_msg(MRC, SIZE)
+ # test transid (note we cant test payload because it's randomly gen)
+ assert summary["transaction id"] == b""
+ assert len(summary["transaction id"]) == 0
+ rmr.generate_and_set_transaction_id(sbuf)
+ summary = rmr.message_summary(sbuf)
+ assert summary["transaction id"] != b""
+ assert len(summary["transaction id"]) == 32
+
+ # test meid
+ assert rmr.get_meid(sbuf) == "\x00" * 32
+ assert summary["meid"] is None # the summary printing function shows the above horridness as None
+ rmr.rmr_set_meid(sbuf, b"666", 3)