Skip to content

Commit 108915f

Browse files
committed
add tests for scint in
1 parent ac9583f commit 108915f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/devices/test_scintillator.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ async def scintillator_and_ap_sg(
4646
@pytest.mark.parametrize(
4747
"y, z, expected_position",
4848
[
49+
(100.855, 101.5115, InOut.IN),
4950
(-0.02, 0.1, InOut.OUT),
5051
(0.1, 0.1, InOut.UNKNOWN),
5152
(10.2, 15.6, InOut.UNKNOWN),
@@ -84,6 +85,11 @@ async def test_given_aperture_scatterguard_parked_when_set_to_out_position_then_
8485
assert await scintillator.y_mm.user_setpoint.get_value() == -0.02
8586
assert await scintillator.z_mm.user_setpoint.get_value() == 0.1
8687

88+
await scintillator.selected_pos.set(InOut.IN)
89+
90+
assert await scintillator.y_mm.user_setpoint.get_value() == -100.855
91+
assert await scintillator.z_mm.user_setpoint.get_value() == 101.5115
92+
8793

8894
async def test_given_aperture_scatterguard_not_parked_when_set_to_out_position_then_exception_raised(
8995
scintillator_and_ap_sg: tuple[Scintillator, ApertureScatterguard],
@@ -92,6 +98,8 @@ async def test_given_aperture_scatterguard_not_parked_when_set_to_out_position_t
9298
if position != ApertureValue.PARKED:
9399
scintillator, ap_sg = scintillator_and_ap_sg
94100
ap_sg.return_value.selected_aperture.get_value.return_value = position # type: ignore
95-
101+
# there is no assert so why does this work
96102
with pytest.raises(ValueError):
97103
await scintillator.selected_pos.set(InOut.OUT)
104+
with pytest.raises(ValueError):
105+
await scintillator.selected_pos.set(InOut.IN)

0 commit comments

Comments
 (0)