File tree 2 files changed +30
-0
lines changed
2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -375,5 +375,21 @@ def test_2716_payloadType_deprecation(self):
375
375
self .book_queue_name , books_type ,
376
376
payloadType = books_type )
377
377
378
+ def test_2718_verify_msgid (self ):
379
+ "2718 - verify that the msgid property is returned correctly"
380
+ self .__clear_books_queue ()
381
+ books_type = self .connection .gettype (self .book_type_name )
382
+ book = books_type .newobject ()
383
+ book .TITLE , book .AUTHORS , book .PRICE = self .book_data [0 ]
384
+ queue = self .connection .queue (self .book_queue_name , books_type )
385
+ props = self .connection .msgproperties (payload = book )
386
+ self .assertEqual (props .msgid , None )
387
+ queue .enqone (props )
388
+ self .cursor .execute ("select msgid from book_queue_tab" )
389
+ actual_msgid , = self .cursor .fetchone ()
390
+ self .assertEqual (props .msgid , actual_msgid )
391
+ props = queue .deqone ()
392
+ self .assertEqual (props .msgid , actual_msgid )
393
+
378
394
if __name__ == "__main__" :
379
395
test_env .run_test_cases ()
Original file line number Diff line number Diff line change @@ -131,5 +131,19 @@ def test_2804_enq_and_deq_visibility(self):
131
131
messages = other_queue .deqmany (5 )
132
132
self .assertEqual (len (messages ), 0 )
133
133
134
+ def test_2806_verify_msgid (self ):
135
+ "2806 - verify that the msgid property is returned correctly"
136
+ queue = self .__get_and_clear_raw_queue ()
137
+ messages = [self .connection .msgproperties (payload = d ) \
138
+ for d in RAW_PAYLOAD_DATA ]
139
+ queue .enqmany (messages )
140
+ self .cursor .execute ("select msgid from raw_queue_tab" )
141
+ actual_msgids = set (m for m , in self .cursor )
142
+ msgids = set (m .msgid for m in messages )
143
+ self .assertEqual (msgids , actual_msgids )
144
+ messages = queue .deqmany (len (RAW_PAYLOAD_DATA ))
145
+ msgids = set (m .msgid for m in messages )
146
+ self .assertEqual (msgids , actual_msgids )
147
+
134
148
if __name__ == "__main__" :
135
149
test_env .run_test_cases ()
You can’t perform that action at this time.
0 commit comments