diff --git a/hardware-specific-tests/picamera2/test_calibration.py b/hardware-specific-tests/picamera2/test_calibration.py index 6c803aed..909b533e 100644 --- a/hardware-specific-tests/picamera2/test_calibration.py +++ b/hardware-specific-tests/picamera2/test_calibration.py @@ -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 diff --git a/tests/test_camera.py b/tests/test_camera.py index 39a35d89..66091593 100644 --- a/tests/test_camera.py +++ b/tests/test_camera.py @@ -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