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