Add checks for new calibration required property to tests

This commit is contained in:
Julian Stirling 2025-10-26 14:13:37 +00:00
parent cfc1bbbe4c
commit df979eb3cf
2 changed files with 16 additions and 1 deletions

View file

@ -75,6 +75,8 @@ def test_get_tuning_algo(picamera_thing):
def test_calibration(picamera_thing, client):
"""Check that full auto calibrate completes and set the expected values."""
# Check the calibration_required property used by the calibration wizard
assert picamera_thing.calibration_required
# Save copy of default tuning file for end of test
original_default = deepcopy(picamera_thing.default_tuning)
# Tuning should start the same as the server is loading with no settings.
@ -88,7 +90,9 @@ def test_calibration(picamera_thing, client):
# Run full auto calibrate
client.full_auto_calibrate()
# After calibration the tuning files should be different
# After calibration it should report that calibration is no longer required
assert not picamera_thing.calibration_required
# The tuning files should be different
assert picamera_thing.default_tuning != picamera_thing.tuning
# The default should be unchanged
assert picamera_thing.default_tuning == original_default

View file

@ -68,3 +68,14 @@ def test_handle_broken_frame():
for _i in range(15):
array = camera.grab_as_array(portal)
assert isinstance(array, np.ndarray)
def test_simulation_cam_calibration():
"""Test that the simulated camera can be calibrated and reports calibration correctly."""
camera = SimulatedCamera()
with camera_server(camera):
portal = lt.get_blocking_portal(camera)
assert camera.calibration_required
camera.full_auto_calibrate(portal)
assert not camera.calibration_required
assert camera.background_detector_status.ready