From 87c4a2aadf2670dae6ef7764058bce1d050aff69 Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Tue, 30 Jun 2026 16:37:43 +0100 Subject: [PATCH] Provide both required arguments to `move_in_image_coordinates` The integration test checks that moving in image coordinates fails before the CSM thing is calibrated. Unfortunately, it is missing the `y` argument, so it would fail either way. This commit supplies the extra argument so that the failure should come from the right place. It also changes the expected error to `ServerActionError` and adds a check for the message, to verify it is due to missing calibration data. A future version of the LabThings Client (#89) may raise a different error if a required argument is missing, so fixing this will ensure that upstream change doesn't break anything here. --- tests/integration_tests/test_actions.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/integration_tests/test_actions.py b/tests/integration_tests/test_actions.py index d16df380..85aa71b4 100644 --- a/tests/integration_tests/test_actions.py +++ b/tests/integration_tests/test_actions.py @@ -114,8 +114,14 @@ def test_camera_stage_mapping_calibration(simulation_test_env): assert csm.image_to_stage_displacement_matrix is None assert csm.last_calibration is None # And therefore that actions error - with pytest.raises(lt.exceptions.FailedToInvokeActionError): - csm.move_in_image_coordinates(x=10) + with pytest.raises( + lt.exceptions.ServerActionError, + match=( + r"The camera_stage_mapping calibration is not yet available\. " + r"This probably means you need to run the calibration routine\." + ), + ): + csm.move_in_image_coordinates(x=10, y=0) # Calibrate csm.calibrate_xy()