Skip to content

Commit aa826be

Browse files
committed
make changes from comments to test_scintillator.py
1 parent 512a942 commit aa826be

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

tests/devices/test_scintillator.py

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

55
import pytest
66
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
88

99
from dodal.common.beamlines.beamline_parameters import GDABeamlineParameters
1010
from dodal.devices.aperturescatterguard import ApertureScatterguard, ApertureValue
@@ -85,13 +85,20 @@ async def test_given_aperture_scatterguard_parked_when_set_to_out_position_then_
8585

8686
await scintillator.selected_pos.set(InOut.OUT)
8787

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
9097

9198
await scintillator.selected_pos.set(InOut.IN)
9299

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

96103

97104
async def test_given_aperture_scatterguard_not_parked_when_set_to_out_position_then_exception_raised(

0 commit comments

Comments
 (0)