+
+
+def test_alloc_fancy():
+ """test allocation with setting payload, trans, mtype"""
+ pay = b"yoo\x01\x00\x80"
+ sbuf = rmr.rmr_alloc_msg(MRC_SEND, SIZE, payload=pay, gen_transaction_id=True, mtype=14, meid=b"asdf")
+ summary = rmr.message_summary(sbuf)
+ assert summary["payload"] == pay
+ assert summary["payload length"] == 6
+ assert summary["transaction id"] != b"" # hard to test what it will be, but make sure not empty
+ assert summary["message state"] == 0
+ assert summary["message type"] == 14
+ assert summary["meid"] == b"asdf"