From 1ff94c67a8516f17c1be91ba56e5a5b3ab1306c0 Mon Sep 17 00:00:00 2001 From: David Perl Date: Tue, 21 Nov 2023 10:26:31 +0000 Subject: [PATCH] #950 finish cleaning up merge artefacts --- .../tests/test_grid_detection_plan.py | 2 +- .../rotation/tests/test_rotation_callbacks.py | 1 + .../xray_centre/tests/test_zocalo_handler.py | 14 +++++++++----- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/hyperion/experiment_plans/tests/test_grid_detection_plan.py b/src/hyperion/experiment_plans/tests/test_grid_detection_plan.py index c7d5fc73f..243788189 100644 --- a/src/hyperion/experiment_plans/tests/test_grid_detection_plan.py +++ b/src/hyperion/experiment_plans/tests/test_grid_detection_plan.py @@ -46,7 +46,7 @@ def fake_devices(smargon: Smargon, backlight: Backlight): "dodal.devices.areadetector.plugins.MJPG.Image" ) as mock_image_class: mock_image = MagicMock() - mock_image_class.open.return_value = mock_image + mock_image_class.open.return_value.__enter__.return_value = mock_image composite = OavGridDetectionComposite( backlight=backlight, diff --git a/src/hyperion/external_interaction/callbacks/rotation/tests/test_rotation_callbacks.py b/src/hyperion/external_interaction/callbacks/rotation/tests/test_rotation_callbacks.py index c82b99ff0..10b80908d 100644 --- a/src/hyperion/external_interaction/callbacks/rotation/tests/test_rotation_callbacks.py +++ b/src/hyperion/external_interaction/callbacks/rotation/tests/test_rotation_callbacks.py @@ -152,6 +152,7 @@ def test_nexus_handler_only_writes_once( cb = RotationCallbackCollection.setup() activate_callbacks(cb) cb.ispyb_handler.activity_gated_start = MagicMock(autospec=True) + cb.ispyb_handler.activity_gated_event = MagicMock(autospec=True) cb.ispyb_handler.activity_gated_stop = MagicMock(autospec=True) RE(fake_rotation_scan(params, cb)) diff --git a/src/hyperion/external_interaction/callbacks/xray_centre/tests/test_zocalo_handler.py b/src/hyperion/external_interaction/callbacks/xray_centre/tests/test_zocalo_handler.py index 7e41a7aff..c85f167d0 100644 --- a/src/hyperion/external_interaction/callbacks/xray_centre/tests/test_zocalo_handler.py +++ b/src/hyperion/external_interaction/callbacks/xray_centre/tests/test_zocalo_handler.py @@ -39,8 +39,8 @@ def init_cbs_with_docs_and_mock_zocalo_and_ispyb( "hyperion.external_interaction.callbacks.xray_centre.ispyb_callback.Store3DGridscanInIspyb", lambda _, __: modified_store_grid_scan_mock(dcids=dcids, dcgid=dcgid), ): - callbacks.ispyb_handler.start(td.test_start_document) - callbacks.zocalo_handler.start(td.test_start_document) + callbacks.ispyb_handler.activity_gated_start(td.test_start_document) + callbacks.zocalo_handler.activity_gated_start(td.test_start_document) callbacks.zocalo_handler.zocalo_interactor.wait_for_result = MagicMock() callbacks.zocalo_handler.zocalo_interactor.run_end = MagicMock() callbacks.zocalo_handler.zocalo_interactor.run_start = MagicMock() @@ -67,7 +67,9 @@ def test_execution_of_run_gridscan_triggers_zocalo_calls( callbacks = XrayCentreCallbackCollection.setup() init_cbs_with_docs_and_mock_zocalo_and_ispyb(callbacks, dc_ids, dcg_id) callbacks.ispyb_handler.activity_gated_start(td.test_run_gridscan_start_document) # type: ignore - callbacks.zocalo_handler.start(td.test_run_gridscan_start_document) + callbacks.zocalo_handler.activity_gated_start( + td.test_run_gridscan_start_document + ) callbacks.ispyb_handler.activity_gated_descriptor( td.test_descriptor_document_pre_data_collection ) # type: ignore @@ -111,10 +113,12 @@ def test_zocalo_called_to_wait_on_results_when_communicator_wait_for_results_cal ): callbacks = XrayCentreCallbackCollection.setup() init_cbs_with_docs_and_mock_zocalo_and_ispyb(callbacks) - callbacks.ispyb_handler.descriptor( + callbacks.ispyb_handler.activity_gated_descriptor( td.test_descriptor_document_pre_data_collection ) - callbacks.ispyb_handler.event(td.test_event_document_pre_data_collection) + callbacks.ispyb_handler.activity_gated_event( + td.test_event_document_pre_data_collection + ) callbacks.ispyb_handler.activity_gated_start(td.test_run_gridscan_start_document) # type: ignore callbacks.ispyb_handler.activity_gated_descriptor(