mirror of
https://github.com/bec-project/ophyd_devices.git
synced 2025-06-23 19:27:59 +02:00
fix: removed __init__ from eiger9mcSAXS
This commit is contained in:
@ -398,31 +398,6 @@ class Eiger9McSAXS(PSIDetectorBase):
|
|||||||
cam = ADCpt(SLSDetectorCam, "cam1:")
|
cam = ADCpt(SLSDetectorCam, "cam1:")
|
||||||
MIN_READOUT = 3e-3
|
MIN_READOUT = 3e-3
|
||||||
|
|
||||||
def __init__(
|
|
||||||
self,
|
|
||||||
prefix="",
|
|
||||||
*,
|
|
||||||
name,
|
|
||||||
kind=None,
|
|
||||||
read_attrs=None,
|
|
||||||
configuration_attrs=None,
|
|
||||||
parent=None,
|
|
||||||
device_manager=None,
|
|
||||||
sim_mode=False,
|
|
||||||
**kwargs,
|
|
||||||
):
|
|
||||||
super().__init__(
|
|
||||||
prefix,
|
|
||||||
name=name,
|
|
||||||
kind=kind,
|
|
||||||
read_attrs=read_attrs,
|
|
||||||
configuration_attrs=configuration_attrs,
|
|
||||||
parent=parent,
|
|
||||||
device_manager=device_manager,
|
|
||||||
sim_mode=sim_mode,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
def set_trigger(self, trigger_source: TriggerSource) -> None:
|
def set_trigger(self, trigger_source: TriggerSource) -> None:
|
||||||
"""Set trigger source for the detector.
|
"""Set trigger source for the detector.
|
||||||
Check the TriggerSource enum for possible values
|
Check the TriggerSource enum for possible values
|
||||||
|
@ -29,9 +29,9 @@ def mock_det():
|
|||||||
with mock.patch.object(dm, "producer"):
|
with mock.patch.object(dm, "producer"):
|
||||||
with mock.patch(
|
with mock.patch(
|
||||||
"ophyd_devices.epics.devices.psi_detector_base.FileWriterMixin"
|
"ophyd_devices.epics.devices.psi_detector_base.FileWriterMixin"
|
||||||
) as filemixin, mock.patch(
|
), mock.patch(
|
||||||
"ophyd_devices.epics.devices.psi_detector_base.PSIDetectorBase._update_service_config"
|
"ophyd_devices.epics.devices.psi_detector_base.PSIDetectorBase._update_service_config"
|
||||||
) as mock_service_config:
|
):
|
||||||
with mock.patch.object(ophyd, "cl") as mock_cl:
|
with mock.patch.object(ophyd, "cl") as mock_cl:
|
||||||
mock_cl.get_pv = MockPV
|
mock_cl.get_pv = MockPV
|
||||||
mock_cl.thread_class = threading.Thread
|
mock_cl.thread_class = threading.Thread
|
||||||
@ -52,9 +52,9 @@ def test_init():
|
|||||||
with mock.patch.object(dm, "producer"):
|
with mock.patch.object(dm, "producer"):
|
||||||
with mock.patch(
|
with mock.patch(
|
||||||
"ophyd_devices.epics.devices.psi_detector_base.FileWriterMixin"
|
"ophyd_devices.epics.devices.psi_detector_base.FileWriterMixin"
|
||||||
) as filemixin, mock.patch(
|
), mock.patch(
|
||||||
"ophyd_devices.epics.devices.psi_detector_base.PSIDetectorBase._update_service_config"
|
"ophyd_devices.epics.devices.psi_detector_base.PSIDetectorBase._update_service_config"
|
||||||
) as mock_service_config:
|
):
|
||||||
with mock.patch.object(ophyd, "cl") as mock_cl:
|
with mock.patch.object(ophyd, "cl") as mock_cl:
|
||||||
mock_cl.get_pv = MockPV
|
mock_cl.get_pv = MockPV
|
||||||
with mock.patch(
|
with mock.patch(
|
||||||
@ -396,12 +396,12 @@ def test_unstage(
|
|||||||
mock_det._stopped = stopped
|
mock_det._stopped = stopped
|
||||||
if expected_exception:
|
if expected_exception:
|
||||||
mock_det.unstage()
|
mock_det.unstage()
|
||||||
assert mock_det._stopped == True
|
assert mock_det._stopped is True
|
||||||
else:
|
else:
|
||||||
mock_det.unstage()
|
mock_det.unstage()
|
||||||
mock_finished.assert_called_once()
|
mock_finished.assert_called_once()
|
||||||
mock_publish_file_location.assert_called_with(done=True, successful=True)
|
mock_publish_file_location.assert_called_with(done=True, successful=True)
|
||||||
assert mock_det._stopped == False
|
assert mock_det._stopped is False
|
||||||
|
|
||||||
|
|
||||||
def test_stop_detector_backend(mock_det):
|
def test_stop_detector_backend(mock_det):
|
||||||
@ -456,7 +456,7 @@ def test_stop(mock_det):
|
|||||||
mock_det.stop()
|
mock_det.stop()
|
||||||
mock_stop_det.assert_called_once()
|
mock_stop_det.assert_called_once()
|
||||||
mock_stop_detector_backend.assert_called_once()
|
mock_stop_detector_backend.assert_called_once()
|
||||||
assert mock_det._stopped == True
|
assert mock_det._stopped is True
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
@ -520,13 +520,13 @@ def test_finished(mock_det, stopped, cam_state, daq_status, scaninfo, expected_e
|
|||||||
with pytest.raises(Exception):
|
with pytest.raises(Exception):
|
||||||
mock_det.timeout = 0.1
|
mock_det.timeout = 0.1
|
||||||
mock_det.custom_prepare.finished()
|
mock_det.custom_prepare.finished()
|
||||||
assert mock_det._stopped == stopped
|
assert mock_det._stopped is stopped
|
||||||
mock_stop_backend.assert_called()
|
mock_stop_backend.assert_called()
|
||||||
mock_stop_det.assert_called_once()
|
mock_stop_det.assert_called_once()
|
||||||
else:
|
else:
|
||||||
mock_det.custom_prepare.finished()
|
mock_det.custom_prepare.finished()
|
||||||
if stopped:
|
if stopped:
|
||||||
assert mock_det._stopped == stopped
|
assert mock_det._stopped is stopped
|
||||||
|
|
||||||
mock_stop_backend.assert_called()
|
mock_stop_backend.assert_called()
|
||||||
mock_stop_det.assert_called_once()
|
mock_stop_det.assert_called_once()
|
||||||
|
Reference in New Issue
Block a user