Skip to content

Commit 7b14545

Browse files
authored
Fix so that patched motor dial limits are not none (#1717)
1 parent ac5c734 commit 7b14545

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ description = "Ophyd devices and other utils that could be used across DLS beaml
1414
dependencies = [
1515
"click",
1616
"ophyd",
17-
"ophyd-async[ca,pva]>=0.13.5",
17+
"ophyd-async[ca,pva]>=0.13.7",
1818
"bluesky>=1.14.5",
1919
"pyepics",
2020
"dataclasses-json",

src/dodal/testing/setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def patch_motor(
3939
set_mock_value(motor.max_velocity, max_velocity)
4040
set_mock_value(motor.low_limit_travel, low_limit_travel)
4141
set_mock_value(motor.high_limit_travel, high_limit_travel)
42+
set_mock_value(motor.dial_low_limit_travel, low_limit_travel)
43+
set_mock_value(motor.dial_high_limit_travel, high_limit_travel)
4244
return callback_on_mock_put(
4345
motor.user_setpoint,
4446
lambda pos, *args, **kwargs: set_mock_value(motor.user_readback, pos),

tests/devices/test_smargon.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,16 @@ async def test_given_center_disp_low_when_stub_offsets_set_to_center_and_moved_t
108108
async def test_given_set_with_value_outside_motor_limit(
109109
smargon: Smargon, test_x, test_y, test_z, test_omega, test_chi, test_phi
110110
):
111-
set_mock_value(smargon.x.low_limit_travel, -1999)
112-
set_mock_value(smargon.y.low_limit_travel, -1999)
113-
set_mock_value(smargon.z.low_limit_travel, -1999)
114-
set_mock_value(smargon.omega.low_limit_travel, -1999)
115-
set_mock_value(smargon.chi.low_limit_travel, -1999)
116-
set_mock_value(smargon.phi.low_limit_travel, -1999)
117-
set_mock_value(smargon.x.high_limit_travel, 1999)
118-
set_mock_value(smargon.y.high_limit_travel, 1999)
119-
set_mock_value(smargon.z.high_limit_travel, 1999)
120-
set_mock_value(smargon.omega.high_limit_travel, 1999)
121-
set_mock_value(smargon.chi.high_limit_travel, 1999)
122-
set_mock_value(smargon.phi.high_limit_travel, 1999)
111+
for motor in [
112+
smargon.x,
113+
smargon.y,
114+
smargon.z,
115+
smargon.omega,
116+
smargon.chi,
117+
smargon.phi,
118+
]:
119+
set_mock_value(motor.low_limit_travel, -1999)
120+
set_mock_value(motor.high_limit_travel, 1999)
123121

124122
with pytest.raises(MotorLimitsError):
125123
await smargon.set(

0 commit comments

Comments
 (0)