def test_validate_image_adds_channel_dimension(self) -> None:
        """Test validation of an image batch without channel dimension."""
        # Create a 3D image batch without channel dimension
        input_batch = np.zeros((32, 224, 224))

        # Validate the image batch
        validated_batch = self.validator.validate_image(input_batch)
        # Check if channel dimension is added
        assert validated_batch.shape == (32, 224, 224, 1), "Channel dimension should be added"
        # Ensure the dtype is converted to float32
        assert validated_batch.dtype == np.float32, "Image batch should be converted to float32"
        # Verify that the image content is preserved
        assert pytest.approx(validated_batch[:, :, :, 0]) == input_batch.astype(
            np.float32,
        ), "Image content should be preserved"
Test validation of an image batch without channel dimension.
tests/unit/data/validators/numpy/test_image.py