Apply suggestions from code review of branch camera_modes

Co-authored-by: Joe Knapper <joe.knapper@glasgow.ac.uk>
This commit is contained in:
Julian Stirling 2026-06-05 15:53:04 +00:00
parent bc7204f554
commit 071d62e8a0
11 changed files with 28 additions and 28 deletions

View file

@ -52,9 +52,9 @@ def test_format(picamera_client):
image_format="png",
retain_image=True,
)
jpeg_capture = Image.open(blob.open())
jpeg_capture.verify()
assert jpeg_capture.format == "PNG"
png_capture = Image.open(blob.open())
png_capture.verify()
assert png_capture.format == "PNG"
def test_standard_capture_size(picamera_client):

View file

@ -53,7 +53,7 @@ def test_grab_jpeg(simulation_test_env):
def test_capture_and_metadata(simulation_test_env, image_format, caplog):
"""Capture an image and check a attributes.
- Check that the position is encoded into the image metadata.
- Check that the position is encoded into the image metadata
- Check the dimensions
- Check the format
"""

View file

@ -86,7 +86,7 @@ class MemorySaveTestCase:
SAVE_TEST_CASES = [
# Default test case is a jpeg, ckec it works with all extensions.
# Default test case is a jpeg, check it works with all extensions.
MemorySaveTestCase("foobar.jpeg"),
MemorySaveTestCase("foobar.jpg"),
MemorySaveTestCase("foobar.JPEG"),
@ -103,7 +103,7 @@ SAVE_TEST_CASES = [
@pytest.mark.parametrize("test_case", SAVE_TEST_CASES)
def test_save_from_memory(test_case, test_env, mocker):
"""Check the correct timage is retrieved and saved with correct settings."""
"""Check the correct image is retrieved and saved with correct settings."""
camera = test_env.get_thing_by_type(SimulatedCamera)
camera._memory_buffer = mocker.Mock()
camera._add_metadata_to_capture = mocker.Mock()

View file

@ -90,7 +90,7 @@ def test_get_two_images():
)
returned_image1, _, _ = mem_buf.get_image(buffer_id1)
returned_image2, _, _ = mem_buf.get_image(buffer_id2)
# It they the same images
# Assert they are the same images
assert misc_image1 is returned_image1
assert misc_image2 is returned_image2
# They are removed from memory
@ -134,7 +134,7 @@ def test_buffer_size_changing():
with pytest.raises(NoImageInMemoryError):
mem_buf.get_image(buffer_id2)
returned_image3, _, _ = mem_buf.get_image(buffer_id3)
# Image 3 the expected image
# Image 3 is the expected image
assert misc_image3 is returned_image3
@ -226,7 +226,7 @@ def test_get_metadata_too():
def test_mode_is_returned():
"""Capture 10 images with metadata and check metadata is returned as expected."""
"""Check that the correct mode name is returned with the image from the buffer."""
mem_buf = CameraMemoryBuffer()
misc_image = random_image()
buffer_id = mem_buf.add_image(misc_image, random_metadata(), "standard")

View file

@ -92,7 +92,7 @@ def test_saving_thing_propagates_on_join():
path2 = path.join("bar")
assert not path2.save_location_set
# Set thing and check joiend path is as expected
# Set thing and check joined path is as expected
path2.set_saving_thing(thing)
assert path2.save_location_set
assert path2.abs_data_path == os.path.join("data", "thing", "foo", "bar")