Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
(#973) Changes requested done
Browse files Browse the repository at this point in the history
  • Loading branch information
subinsaji committed Dec 7, 2023
1 parent e1a6c04 commit 3e85c40
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions tests/unit_tests/experiment_plans/test_pin_tip_centring.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
)


def mock_generator(x, y):
def get_fake_pin_values_generator(x, y):
yield from null()
return x, y

Expand Down Expand Up @@ -86,11 +86,11 @@ def set_pin_tip_when_x_moved(*args, **kwargs):

@patch("hyperion.experiment_plans.pin_tip_centring_plan.trigger_and_return_pin_tip")
def test_pin_tip_starting_near_negative_edge_doesnt_exceed_limit(
mock_move_pin_into_view: MagicMock, smargon: Smargon, oav: OAV, RE: RunEngine
mock_trigger_and_return_tip: MagicMock, smargon: Smargon, oav: OAV, RE: RunEngine
):
mock_move_pin_into_view.side_effect = [
mock_generator(0, 0),
mock_generator(0, 0),
mock_trigger_and_return_tip.side_effect = [
get_fake_pin_values_generator(0, 100),
get_fake_pin_values_generator(0, 100),
]

smargon.x.user_setpoint.sim_set_limits([-2, 2])
Expand All @@ -105,11 +105,14 @@ def test_pin_tip_starting_near_negative_edge_doesnt_exceed_limit(

@patch("hyperion.experiment_plans.pin_tip_centring_plan.trigger_and_return_pin_tip")
def test_pin_tip_starting_near_positive_edge_doesnt_exceed_limit(
mock_move_pin_into_view: MagicMock, smargon: Smargon, oav: OAV, RE: RunEngine
mock_trigger_and_return_pin_tip: MagicMock,
smargon: Smargon,
oav: OAV,
RE: RunEngine,
):
mock_move_pin_into_view.side_effect = [
mock_generator(-1, -1),
mock_generator(-1, -1),
mock_trigger_and_return_pin_tip.side_effect = [
get_fake_pin_values_generator(-1, -1),
get_fake_pin_values_generator(-1, -1),
]
smargon.x.user_setpoint.sim_set_limits([-2, 2])
smargon.x.user_setpoint.sim_put(1.8)
Expand Down

0 comments on commit 3e85c40

Please sign in to comment.