|
4 | 4 |
|
5 | 5 | import pytest |
6 | 6 | from ophyd_async.core import init_devices |
7 | | -from ophyd_async.testing import get_mock_put |
| 7 | +from ophyd_async.testing import assert_value, get_mock_put |
8 | 8 |
|
9 | 9 | from dodal.common.beamlines.beamline_parameters import GDABeamlineParameters |
10 | 10 | from dodal.devices.aperturescatterguard import ApertureScatterguard, ApertureValue |
@@ -85,13 +85,20 @@ async def test_given_aperture_scatterguard_parked_when_set_to_out_position_then_ |
85 | 85 |
|
86 | 86 | await scintillator.selected_pos.set(InOut.OUT) |
87 | 87 |
|
88 | | - assert await scintillator.y_mm.user_setpoint.get_value() == -0.02 |
89 | | - assert await scintillator.z_mm.user_setpoint.get_value() == 0.1 |
| 88 | + await assert_value(scintillator.y_mm.user_setpoint, -0.02) |
| 89 | + await assert_value(scintillator.z_mm.user_setpoint, -0.1) |
| 90 | + |
| 91 | + |
| 92 | +async def test_given_aperture_scatterguard_parked_when_set_to_in_position_then_returns_expected( |
| 93 | + scintillator_and_ap_sg: tuple[Scintillator, ApertureScatterguard], |
| 94 | +): |
| 95 | + scintillator, ap_sg = scintillator_and_ap_sg |
| 96 | + ap_sg.return_value.selected_aperture.get_value.return_value = ApertureValue.PARKED # type: ignore |
90 | 97 |
|
91 | 98 | await scintillator.selected_pos.set(InOut.IN) |
92 | 99 |
|
93 | | - assert await scintillator.y_mm.user_setpoint.get_value() == 100.855 |
94 | | - assert await scintillator.z_mm.user_setpoint.get_value() == 101.5115 |
| 100 | + await assert_value(scintillator.y_mm.user_setpoint, 100.855) |
| 101 | + await assert_value(scintillator.z_mm.user_setpoint, 101.5115) |
95 | 102 |
|
96 | 103 |
|
97 | 104 | async def test_given_aperture_scatterguard_not_parked_when_set_to_out_position_then_exception_raised( |
|
0 commit comments