code: def test_small_palette():
      # Arrange
      im = hopper()
  
      colors = (255, 0, 0, 0, 0, 255)
      p = Image.new("P", (1, 1))
      p.putpalette(colors)
  
      # Act
      im = im.quantize(palette=p)
  
      # Assert
      assert len(im.getcolors()) == 2
  
file_path: pillow/Tests/test_image_quantize.py
imports: from __future__ import annotations
  import pytest
  from packaging.version import parse
  from PIL import Image, features
  from .helper import assert_image_similar, hopper, is_ppc64le, skip_unless_feature
label_desc: Use image node_id 12 for calling a global function with example usage: test_small_palette() without return types