Skip to content

Commit

Permalink
Fix issues from ophyd-asyn update
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicOram committed Sep 5, 2024
1 parent 13d9f43 commit fdbd95a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/unit_tests/beamlines/i04/test_thawing.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def test_given_different_rotations_then_motor_moved_relative(
expected_end: float,
RE: RunEngine,
):
set_mock_value(smargon.omega.user_readback, start_pos)
set_mock_value(smargon.omega.user_setpoint, start_pos)
RE(thaw(10, rotation, thawer=thawer, smargon=smargon))
assert get_mock_put(smargon.omega.user_setpoint).call_args_list == [
call(expected_end, wait=ANY, timeout=ANY),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ def test_robot_load_then_centre_doesnt_set_energy_if_not_specified_and_current_e
):
robot_load_composite.eiger.set_detector_parameters = MagicMock()
sim_run_engine.add_handler(
"read",
lambda msg: {"dcm-energy_in_kev": {"value": 11.105}},
"locate",
lambda msg: {"readback": 11.105},
"dcm-energy_in_kev",
)
messages = sim_run_engine.simulate_plan(
Expand Down Expand Up @@ -165,8 +165,8 @@ def return_not_disabled_after_reads(_):
return {"values": {"value": int(num_of_reads < total_disabled_reads)}}

sim_run_engine.add_handler(
"read",
lambda msg: {"dcm-energy_in_kev": {"value": 11.105}},
"locate",
lambda msg: {"readback": 11.105},
"dcm-energy_in_kev",
)
sim_run_engine.add_handler(
Expand Down Expand Up @@ -370,11 +370,11 @@ def test_given_lower_gonio_moved_when_robot_load_then_lower_gonio_moved_to_home_
initial_values = {"x": 0.11, "y": 0.12, "z": 0.13}

def get_read(axis, msg):
return {f"lower_gonio-{axis}": {"value": initial_values[axis]}}
return {"readback": initial_values[axis]}

for axis in initial_values.keys():
sim_run_engine.add_handler(
"read", partial(get_read, axis), f"lower_gonio-{axis}"
"locate", partial(get_read, axis), f"lower_gonio-{axis}"
)

messages = sim_run_engine.simulate_plan(
Expand Down

0 comments on commit fdbd95a

Please sign in to comment.