@@ -64,25 +64,27 @@ def test_in_order_messages_are_handled_in_order(self):
64
64
messages = [
65
65
{
66
66
"event" : {"kind" : "test" , "order" : 0 },
67
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
67
+ "attributes" : {"sender_type" : "CHILD" },
68
68
},
69
69
{
70
70
"event" : {"kind" : "test" , "order" : 1 },
71
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
71
+ "attributes" : {"sender_type" : "CHILD" },
72
72
},
73
73
{
74
74
"event" : {"kind" : "test" , "order" : 2 },
75
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
75
+ "attributes" : {"sender_type" : "CHILD" },
76
76
},
77
77
{
78
78
"event" : {"kind" : "finish-test" , "order" : 3 },
79
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
79
+ "attributes" : {"sender_type" : "CHILD" },
80
80
},
81
81
]
82
82
83
83
for message in messages :
84
84
child ._emit_event (
85
85
event = message ["event" ],
86
+ question_uuid = self .question_uuid ,
87
+ parent_question_uuid = None ,
86
88
attributes = message ["attributes" ],
87
89
originator = self .parent .id ,
88
90
recipient = self .parent .id ,
@@ -116,25 +118,27 @@ def test_out_of_order_messages_are_handled_in_order(self):
116
118
messages = [
117
119
{
118
120
"event" : {"kind" : "test" , "order" : 1 },
119
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
121
+ "attributes" : {"sender_type" : "CHILD" },
120
122
},
121
123
{
122
124
"event" : {"kind" : "test" , "order" : 2 },
123
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
125
+ "attributes" : {"sender_type" : "CHILD" },
124
126
},
125
127
{
126
128
"event" : {"kind" : "test" , "order" : 0 },
127
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
129
+ "attributes" : {"sender_type" : "CHILD" },
128
130
},
129
131
{
130
132
"event" : {"kind" : "finish-test" , "order" : 3 },
131
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
133
+ "attributes" : {"sender_type" : "CHILD" },
132
134
},
133
135
]
134
136
135
137
for message in messages :
136
138
child ._emit_event (
137
139
event = message ["event" ],
140
+ question_uuid = self .question_uuid ,
141
+ parent_question_uuid = None ,
138
142
attributes = message ["attributes" ],
139
143
originator = self .parent .id ,
140
144
recipient = self .parent .id ,
@@ -171,25 +175,27 @@ def test_out_of_order_messages_with_end_message_first_are_handled_in_order(self)
171
175
messages = [
172
176
{
173
177
"event" : {"kind" : "finish-test" , "order" : 3 },
174
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
178
+ "attributes" : {"sender_type" : "CHILD" },
175
179
},
176
180
{
177
181
"event" : {"kind" : "test" , "order" : 1 },
178
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
182
+ "attributes" : {"sender_type" : "CHILD" },
179
183
},
180
184
{
181
185
"event" : {"kind" : "test" , "order" : 2 },
182
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
186
+ "attributes" : {"sender_type" : "CHILD" },
183
187
},
184
188
{
185
189
"event" : {"kind" : "test" , "order" : 0 },
186
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
190
+ "attributes" : {"sender_type" : "CHILD" },
187
191
},
188
192
]
189
193
190
194
for message in messages :
191
195
child ._emit_event (
192
196
event = message ["event" ],
197
+ question_uuid = self .question_uuid ,
198
+ parent_question_uuid = None ,
193
199
attributes = message ["attributes" ],
194
200
originator = self .parent .id ,
195
201
recipient = self .parent .id ,
@@ -224,21 +230,23 @@ def test_no_timeout(self):
224
230
messages = [
225
231
{
226
232
"event" : {"kind" : "test" , "order" : 0 },
227
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
233
+ "attributes" : {"sender_type" : "CHILD" },
228
234
},
229
235
{
230
236
"event" : {"kind" : "test" , "order" : 1 },
231
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
237
+ "attributes" : {"sender_type" : "CHILD" },
232
238
},
233
239
{
234
240
"event" : {"kind" : "finish-test" , "order" : 2 },
235
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
241
+ "attributes" : {"sender_type" : "CHILD" },
236
242
},
237
243
]
238
244
239
245
for message in messages :
240
246
child ._emit_event (
241
247
event = message ["event" ],
248
+ question_uuid = self .question_uuid ,
249
+ parent_question_uuid = None ,
242
250
attributes = message ["attributes" ],
243
251
originator = self .parent .id ,
244
252
recipient = self .parent .id ,
@@ -265,17 +273,19 @@ def test_delivery_acknowledgement(self):
265
273
"datetime" : datetime .datetime .utcnow ().isoformat (),
266
274
"order" : 0 ,
267
275
},
268
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
276
+ "attributes" : {"sender_type" : "CHILD" },
269
277
},
270
278
{
271
279
"event" : {"kind" : "result" , "order" : 1 },
272
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
280
+ "attributes" : {"sender_type" : "CHILD" },
273
281
},
274
282
]
275
283
276
284
for message in messages :
277
285
child ._emit_event (
278
286
event = message ["event" ],
287
+ question_uuid = self .question_uuid ,
288
+ parent_question_uuid = None ,
279
289
attributes = message ["attributes" ],
280
290
originator = self .parent .id ,
281
291
recipient = self .parent .id ,
@@ -318,17 +328,19 @@ def test_error_not_raised_if_heartbeat_has_been_received_in_maximum_allowed_inte
318
328
"datetime" : datetime .datetime .utcnow ().isoformat (),
319
329
"order" : 0 ,
320
330
},
321
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
331
+ "attributes" : {"sender_type" : "CHILD" },
322
332
},
323
333
{
324
334
"event" : {"kind" : "result" , "order" : 1 },
325
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
335
+ "attributes" : {"sender_type" : "CHILD" },
326
336
},
327
337
]
328
338
329
339
for message in messages :
330
340
child ._emit_event (
331
341
event = message ["event" ],
342
+ question_uuid = self .question_uuid ,
343
+ parent_question_uuid = None ,
332
344
attributes = message ["attributes" ],
333
345
originator = self .parent .id ,
334
346
recipient = self .parent .id ,
@@ -376,25 +388,27 @@ def test_missing_messages_at_start_can_be_skipped(self):
376
388
messages = [
377
389
{
378
390
"event" : {"kind" : "test" , "order" : 2 },
379
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
391
+ "attributes" : {"sender_type" : "CHILD" },
380
392
},
381
393
{
382
394
"event" : {"kind" : "test" , "order" : 3 },
383
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
395
+ "attributes" : {"sender_type" : "CHILD" },
384
396
},
385
397
{
386
398
"event" : {"kind" : "test" , "order" : 4 },
387
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
399
+ "attributes" : {"sender_type" : "CHILD" },
388
400
},
389
401
{
390
402
"event" : {"kind" : "finish-test" , "order" : 5 },
391
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
403
+ "attributes" : {"sender_type" : "CHILD" },
392
404
},
393
405
]
394
406
395
407
for message in messages :
396
408
child ._emit_event (
397
409
event = message ["event" ],
410
+ question_uuid = self .question_uuid ,
411
+ parent_question_uuid = None ,
398
412
attributes = message ["attributes" ],
399
413
originator = self .parent .id ,
400
414
recipient = self .parent .id ,
@@ -437,21 +451,23 @@ def test_missing_messages_in_middle_can_skipped(self):
437
451
messages = [
438
452
{
439
453
"event" : {"kind" : "test" , "order" : 0 },
440
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
454
+ "attributes" : {"sender_type" : "CHILD" },
441
455
},
442
456
{
443
457
"event" : {"kind" : "test" , "order" : 1 },
444
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
458
+ "attributes" : {"sender_type" : "CHILD" },
445
459
},
446
460
{
447
461
"event" : {"kind" : "test" , "order" : 2 },
448
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
462
+ "attributes" : {"sender_type" : "CHILD" },
449
463
},
450
464
]
451
465
452
466
for message in messages :
453
467
child ._emit_event (
454
468
event = message ["event" ],
469
+ question_uuid = self .question_uuid ,
470
+ parent_question_uuid = None ,
455
471
attributes = message ["attributes" ],
456
472
originator = self .parent .id ,
457
473
recipient = self .parent .id ,
@@ -461,7 +477,9 @@ def test_missing_messages_in_middle_can_skipped(self):
461
477
# Send a final message.
462
478
child ._emit_event (
463
479
event = {"kind" : "finish-test" , "order" : 5 },
464
- attributes = {"question_uuid" : self .question_uuid , "sender_type" : "CHILD" },
480
+ question_uuid = self .question_uuid ,
481
+ parent_question_uuid = None ,
482
+ attributes = {"sender_type" : "CHILD" },
465
483
originator = self .parent .id ,
466
484
recipient = self .parent .id ,
467
485
# Simulate missing messages.
@@ -504,21 +522,23 @@ def test_multiple_blocks_of_missing_messages_in_middle_can_skipped(self):
504
522
messages = [
505
523
{
506
524
"event" : {"kind" : "test" , "order" : 0 },
507
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
525
+ "attributes" : {"sender_type" : "CHILD" },
508
526
},
509
527
{
510
528
"event" : {"kind" : "test" , "order" : 1 },
511
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
529
+ "attributes" : {"sender_type" : "CHILD" },
512
530
},
513
531
{
514
532
"event" : {"kind" : "test" , "order" : 2 },
515
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
533
+ "attributes" : {"sender_type" : "CHILD" },
516
534
},
517
535
]
518
536
519
537
for message in messages :
520
538
child ._emit_event (
521
539
event = message ["event" ],
540
+ question_uuid = self .question_uuid ,
541
+ parent_question_uuid = None ,
522
542
attributes = message ["attributes" ],
523
543
originator = self .parent .id ,
524
544
recipient = self .parent .id ,
@@ -528,7 +548,9 @@ def test_multiple_blocks_of_missing_messages_in_middle_can_skipped(self):
528
548
# Send another message.
529
549
child ._emit_event (
530
550
event = {"kind" : "test" , "order" : 5 },
531
- attributes = {"order" : 5 , "question_uuid" : self .question_uuid , "sender_type" : "CHILD" },
551
+ question_uuid = self .question_uuid ,
552
+ parent_question_uuid = None ,
553
+ attributes = {"order" : 5 , "sender_type" : "CHILD" },
532
554
originator = self .parent .id ,
533
555
recipient = self .parent .id ,
534
556
# Simulate missing messages.
@@ -539,25 +561,27 @@ def test_multiple_blocks_of_missing_messages_in_middle_can_skipped(self):
539
561
messages = [
540
562
{
541
563
"event" : {"kind" : "test" , "order" : 20 },
542
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
564
+ "attributes" : {"sender_type" : "CHILD" },
543
565
},
544
566
{
545
567
"event" : {"kind" : "test" , "order" : 21 },
546
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
568
+ "attributes" : {"sender_type" : "CHILD" },
547
569
},
548
570
{
549
571
"event" : {"kind" : "test" , "order" : 22 },
550
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
572
+ "attributes" : {"sender_type" : "CHILD" },
551
573
},
552
574
{
553
575
"event" : {"kind" : "finish-test" , "order" : 23 },
554
- "attributes" : {"question_uuid" : self . question_uuid , " sender_type" : "CHILD" },
576
+ "attributes" : {"sender_type" : "CHILD" },
555
577
},
556
578
]
557
579
558
580
for message in messages :
559
581
child ._emit_event (
560
582
event = message ["event" ],
583
+ question_uuid = self .question_uuid ,
584
+ parent_question_uuid = None ,
561
585
attributes = message ["attributes" ],
562
586
originator = self .parent .id ,
563
587
recipient = self .parent .id ,
@@ -610,7 +634,9 @@ def test_all_messages_missing_apart_from_result(self):
610
634
# Send the result message.
611
635
child ._emit_event (
612
636
event = {"kind" : "finish-test" , "order" : 1000 },
613
- attributes = {"question_uuid" : self .question_uuid , "sender_type" : "CHILD" },
637
+ question_uuid = self .question_uuid ,
638
+ parent_question_uuid = None ,
639
+ attributes = {"sender_type" : "CHILD" },
614
640
originator = self .parent .id ,
615
641
recipient = self .parent .id ,
616
642
# Simulate missing messages.
0 commit comments