Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
#950 finish cleaning up merge artefacts
Browse files Browse the repository at this point in the history
  • Loading branch information
dperl-dls committed Nov 21, 2023
1 parent 0635428 commit 1ff94c6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 1ff94c6

Please sign in to comment.