Skip to content

Commit 804a3be

Browse files
committed
make changes from comments to test_scintillator.py
1 parent 2fe3797 commit 804a3be

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

tests/devices/test_scintillator.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import pytest
66
from ophyd_async.core import init_devices
7+
from ophyd_async.testing import assert_value
78

89
from dodal.common.beamlines.beamline_parameters import GDABeamlineParameters
910
from dodal.devices.aperturescatterguard import ApertureScatterguard, ApertureValue
@@ -82,13 +83,20 @@ async def test_given_aperture_scatterguard_parked_when_set_to_out_position_then_
8283

8384
await scintillator.selected_pos.set(InOut.OUT)
8485

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
8795

8896
await scintillator.selected_pos.set(InOut.IN)
8997

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)
92100

93101

94102
async def test_given_aperture_scatterguard_not_parked_when_set_to_out_position_then_exception_raised(

0 commit comments

Comments
 (0)