mirror of
https://github.com/bec-project/ophyd_devices.git
synced 2026-02-04 22:28:41 +01:00
tests(psi-motors): add test for high limit switch
This commit is contained in:
@@ -165,3 +165,13 @@ def test_move_epics_motor_ec(mock_epics_motor_ec):
|
||||
status.wait(timeout=5)
|
||||
assert status.done is True
|
||||
motor_ec.low_interlock._read_pv.mock_data = 0
|
||||
|
||||
|
||||
def test_epics_motor_high_limit_switch_raises(mock_epics_motor):
|
||||
"""Test that moving beyond high limit switch raises an error."""
|
||||
motor = mock_epics_motor
|
||||
motor.user_setpoint._metadata["lower_ctrl_limit"] = -10
|
||||
motor.user_setpoint._metadata["upper_ctrl_limit"] = 10
|
||||
motor.high_limit_switch._read_pv.mock_data = 1 # Simulate high limit switch active
|
||||
with pytest.raises(ophyd.utils.LimitError):
|
||||
motor.move(15)
|
||||
|
||||
Reference in New Issue
Block a user