diff --git a/tests/hardware_specific_tests/picamera2/test_acquisition.py b/tests/hardware_specific_tests/picamera2/test_acquisition.py index 7ac49e3a..b33f2154 100644 --- a/tests/hardware_specific_tests/picamera2/test_acquisition.py +++ b/tests/hardware_specific_tests/picamera2/test_acquisition.py @@ -26,7 +26,7 @@ def test_jpeg_and_array(picamera_client): assert jpeg_capture.format == "JPEG" # Capture an array - arrlist = picamera_client.capture_array(stream_name="main") + arrlist = picamera_client.capture_as_array(stream_name="main") array_main = np.array(arrlist) # Verify image sizes are the same diff --git a/tests/hardware_specific_tests/picamera2/test_streaming_mode.py b/tests/hardware_specific_tests/picamera2/test_streaming_mode.py index b1184f80..4add4fb4 100644 --- a/tests/hardware_specific_tests/picamera2/test_streaming_mode.py +++ b/tests/hardware_specific_tests/picamera2/test_streaming_mode.py @@ -14,7 +14,7 @@ def test_streaming_mode(): with camera_test_client() as client: for mode, res in ["default", (820, 616)], ["full_resolution", (3280, 2464)]: client.change_streaming_mode(mode=mode) - arr = np.array(client.capture_array(stream_name="main")) + arr = np.array(client.capture_as_array(stream_name="main")) # Check that the array dimensions match the requested image size. # Note: Numpy array shape is (y,x), but the sensor is set with (x,y) # hence the need to compare index 0 with index 1. diff --git a/tests/integration_tests/test_actions.py b/tests/integration_tests/test_actions.py index 5de893a0..a5df735e 100644 --- a/tests/integration_tests/test_actions.py +++ b/tests/integration_tests/test_actions.py @@ -77,10 +77,10 @@ def test_stage(simulation_test_env): assert start["z"] == pos["z"] -def test_capture_array(simulation_test_env): +def test_capture_as_array(simulation_test_env): """Capture array from simulation and check the size is as expected.""" camera = simulation_test_env.get_thing_client("camera") - array = np.asarray(camera.capture_array()) + array = np.asarray(camera.capture_as_array()) assert array.shape == (616, 820, 3) diff --git a/tests/unit_tests/test_metadata.py b/tests/unit_tests/test_metadata.py index c7ec6b6f..4431d009 100644 --- a/tests/unit_tests/test_metadata.py +++ b/tests/unit_tests/test_metadata.py @@ -169,9 +169,9 @@ def test_picamera_metadata_written_to_exif(mock_picam_thing, temp_jpeg, mocker): mock_interface.get_thing_states.return_value = camera.thing_state camera._thing_server_interface = mock_interface - capture_metadata = camera._capture_metadata() + ofm_metadata = camera._collect_ofm_metadata() - camera._add_metadata_to_capture(str(temp_jpeg), capture_metadata) + camera._add_metadata_to_capture(str(temp_jpeg), ofm_metadata) exif_dict = piexif.load(str(temp_jpeg)) user_comment = json.loads(exif_dict["Exif"][piexif.ExifIFD.UserComment].decode()) diff --git a/tests/unit_tests/test_simulated_camera.py b/tests/unit_tests/test_simulated_camera.py index 99f486be..2c7d4a81 100644 --- a/tests/unit_tests/test_simulated_camera.py +++ b/tests/unit_tests/test_simulated_camera.py @@ -159,12 +159,12 @@ def test_infinite_sample(camera, stage): camera.noise_level = 0 assert not camera.repeating cached_canvas = camera.canvas - array_not_repeating = camera.capture_array() + array_not_repeating = camera.capture_as_array() camera.repeating = True time.sleep(0.2) # Ensure frame regenerates # Canvas shouldn't regenerate assert camera.canvas is cached_canvas - array_repeating = camera.capture_array() + array_repeating = camera.capture_as_array() # Images are identical whether or not repeating assert np.array_equal(array_not_repeating, array_repeating) @@ -174,13 +174,13 @@ def test_infinite_sample(camera, stage): camera.repeating = False time.sleep(0.2) # Ensure frame regenerates # If not repeating the array is just background - assert np.all(camera.capture_array() == simulation.BG_COLOR) + assert np.all(camera.capture_as_array() == simulation.BG_COLOR) # Turn on repeating camera.repeating = True time.sleep(0.2) # Ensure frame regenerates # Sample is now infinite, so not all background - assert not np.all(camera.capture_array() == simulation.BG_COLOR) + assert not np.all(camera.capture_as_array() == simulation.BG_COLOR) def test_simulation_cam_calibration(camera):