+
+
+def test_alloc(monkeypatch):
+ """
+ test alloc with all fields set
+ """
+ rmr_mocks.patch_rmr(monkeypatch)
+ sbuf = rmr.rmr_alloc_msg(
+ MRC, SIZE, payload=b"foo", gen_transaction_id=True, mtype=5, meid=b"mee", sub_id=234, fixed_transaction_id=b"t" * 32
+ )
+ summary = rmr.message_summary(sbuf)
+ assert summary["payload"] == b"foo"
+ assert summary["transaction id"] == b"t" * 32
+ assert summary["message type"] == 5
+ assert summary["meid"] == b"mee"
+ assert summary["subscription id"] == 234