From ef6c074d1ed6cb78fd41627bcfc54aca6ce269de Mon Sep 17 00:00:00 2001 From: David Perl Date: Fri, 8 Mar 2024 09:18:43 +0000 Subject: [PATCH] 685 update rotation smargon test to check VMAX --- tests/conftest.py | 2 ++ .../experiment_plans/test_rotation_scan_plan.py | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 326f470f3..b6a0fec8f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -484,6 +484,8 @@ def fake_create_rotation_devices( smargon.omega.velocity.set = mock_omega_velocity_sets smargon.omega.set = mock_omega_sets + smargon.omega.max_velocity.sim_put(131) # type: ignore + return RotationScanComposite( attenuator=attenuator, backlight=backlight, diff --git a/tests/unit_tests/experiment_plans/test_rotation_scan_plan.py b/tests/unit_tests/experiment_plans/test_rotation_scan_plan.py index 470059b1c..4dc0cb4fe 100644 --- a/tests/unit_tests/experiment_plans/test_rotation_scan_plan.py +++ b/tests/unit_tests/experiment_plans/test_rotation_scan_plan.py @@ -11,7 +11,6 @@ from ophyd.status import Status from hyperion.experiment_plans.rotation_scan_plan import ( - DEFAULT_MAX_VELOCITY, RotationScanComposite, calculate_motion_profile, rotation_scan, @@ -202,6 +201,8 @@ def test_full_rotation_plan_smargon_settings( params: RotationInternalParameters = test_rotation_params expt_params = params.experiment_params + test_max_velocity = smargon.omega.max_velocity.get() + omega_set: MagicMock = smargon.omega.set # type: ignore omega_velocity_set: MagicMock = smargon.omega.velocity.set # type: ignore rotation_speed = ( @@ -216,9 +217,9 @@ def test_full_rotation_plan_smargon_settings( assert omega_set.call_count == 2 assert omega_velocity_set.call_count == 3 assert omega_velocity_set.call_args_list == [ - call(DEFAULT_MAX_VELOCITY), + call(test_max_velocity), call(rotation_speed), - call(DEFAULT_MAX_VELOCITY), + call(test_max_velocity), ] @@ -278,4 +279,3 @@ class MyTestException(Exception): ) assert "Experiment fails because this is a test" in exc.value.args[0] cleanup_plan.assert_called_once() -