@@ -382,3 +382,39 @@ async def test_trigger_stops_once_last_angle_found(
382
382
assert mock_murko_results .pubsub .get_message .call_count == 2
383
383
# 2 batches of 6 = 12
384
384
assert mock_murko_results .redis_client .hget .call_count == 12
385
+
386
+
387
+ @patch ("dodal.devices.i04.murko_results.StrictRedis" )
388
+ async def test_stage_calls_setters_with_0 (
389
+ mock_strict_redis , mock_murko_results , mock_setters
390
+ ):
391
+ mock_x_setter , mock_y_setter , mock_z_setter = mock_setters
392
+
393
+ mock_murko_results .pubsub .subscribe = patch .object (
394
+ mock_strict_redis .pubsub ,
395
+ "subscribe" ,
396
+ new_callable = AsyncMock ,
397
+ ).start ()
398
+
399
+ await mock_murko_results .stage ()
400
+
401
+ assert mock_murko_results .pubsub .subscribe .call_count == 1
402
+ assert mock_x_setter .call_args [0 ][0 ] == 0
403
+ assert mock_y_setter .call_args [0 ][0 ] == 0
404
+ assert mock_z_setter .call_args [0 ][0 ] == 0
405
+
406
+
407
+ @patch ("dodal.devices.i04.murko_results.StrictRedis" )
408
+ async def test_unstage_calls_unsubscribe (
409
+ mock_strict_redis , mock_murko_results , mock_setters
410
+ ):
411
+ mock_x_setter , mock_y_setter , mock_z_setter = mock_setters
412
+
413
+ mock_murko_results .pubsub .unsubscribe = patch .object (
414
+ mock_strict_redis .pubsub ,
415
+ "unsubscribe" ,
416
+ new_callable = AsyncMock ,
417
+ ).start ()
418
+
419
+ await mock_murko_results .unstage ()
420
+ assert mock_murko_results .pubsub .unsubscribe .call_count == 1
0 commit comments