From 16022c53ef9e3134fe486892c27f26e5c12fad2e Mon Sep 17 00:00:00 2001 From: appel_c Date: Tue, 21 Nov 2023 12:31:08 +0100 Subject: [PATCH] fix: renamed to prepare_detector_backend --- tests/test_eiger9m_csaxs.py | 4 +--- tests/test_falcon_csaxs.py | 2 +- tests/test_pilatus_csaxs.py | 12 ++++++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/test_eiger9m_csaxs.py b/tests/test_eiger9m_csaxs.py index 2bb38f8..00ffd80 100644 --- a/tests/test_eiger9m_csaxs.py +++ b/tests/test_eiger9m_csaxs.py @@ -281,7 +281,7 @@ def test_stage( mock_det.cam.beam_energy.put(scaninfo["mokev"]) mock_det.stopped = stopped mock_det.cam.detector_state._read_pv.mock_data = detector_state - with mock.patch.object(mock_det.custom_prepare, "prepare_data_backend") as mock_prep_fw: + with mock.patch.object(mock_det.custom_prepare, "prepare_detector_backend") as mock_prep_fw: mock_det.filepath = scaninfo["filepath"] if expected_exception: with pytest.raises(Exception): @@ -522,8 +522,6 @@ def test_finished(mock_det, stopped, cam_state, daq_status, scaninfo, expected_e mock_det.timeout = 0.1 mock_det.custom_prepare.finished() assert mock_det.stopped is stopped - mock_stop_backend.assert_called() - mock_stop_det.assert_called_once() else: mock_det.custom_prepare.finished() if stopped: diff --git a/tests/test_falcon_csaxs.py b/tests/test_falcon_csaxs.py index e043733..2622a68 100644 --- a/tests/test_falcon_csaxs.py +++ b/tests/test_falcon_csaxs.py @@ -143,7 +143,7 @@ def test_stage(mock_det, scaninfo): This includes testing _prep_det """ with mock.patch.object(mock_det, "set_trigger") as mock_set_trigger, mock.patch.object( - mock_det.custom_prepare, "prepare_data_backend" + mock_det.custom_prepare, "prepare_detector_backend" ) as mock_prep_data_backend, mock.patch.object( mock_det.custom_prepare, "publish_file_location" ) as mock_publish_file_location, mock.patch.object( diff --git a/tests/test_pilatus_csaxs.py b/tests/test_pilatus_csaxs.py index 5038062..81c4629 100644 --- a/tests/test_pilatus_csaxs.py +++ b/tests/test_pilatus_csaxs.py @@ -117,7 +117,7 @@ def test_stage( mock_det.device_manager.add_device("mokev", value=12.4) mock_det.stopped = stopped with mock.patch.object( - mock_det.custom_prepare, "prepare_data_backend" + mock_det.custom_prepare, "prepare_detector_backend" ) as mock_data_backend, mock.patch.object( mock_det.custom_prepare, "update_readout_time" ) as mock_update_readout_time: @@ -288,7 +288,9 @@ def test_stop_detector_backend(mock_det, requests_state, expected_exception, url { "searchPath": "/", "searchPattern": "glob:*.cbf", - "destinationPath": "/sls/X12SA/data/e12345/Data10/pilatus_2/S00000_00999", + "destinationPath": ( + "/sls/X12SA/data/e12345/Data10/pilatus_2/S00000_00999" + ), } ] }, @@ -337,7 +339,9 @@ def test_stop_detector_backend(mock_det, requests_state, expected_exception, url { "searchPath": "/", "searchPattern": "glob:*.cbf", - "destinationPath": "/sls/X12SA/data/e12345/Data10/pilatus_2/S00000_00999", + "destinationPath": ( + "/sls/X12SA/data/e12345/Data10/pilatus_2/S00000_00999" + ), } ] }, @@ -489,7 +493,7 @@ def test_stop(mock_det): ( True, ophyd.Staged.no, - False, + True, ), ( False,