code: def test_encode_registry(self):
      Image.register_encoder("MOCK", mock_encode)
      assert "MOCK" in Image.ENCODERS
  
      enc = Image._getencoder(
          "RGB", "MOCK", ("args",), extra=("extra",)
      )
  
      assert isinstance(enc, MockEncoder)
      assert enc.args == ("RGB", "args", "extra")
  
imports: import io
  import os
  import shutil
  import sys
  import tempfile
  import pytest
  from PIL import Image, ImageDraw, ImagePalette, UnidentifiedImageError
  from .helper import assert_image_equal, assert_image_equal_tofile, assert_image_similar_tofile, assert_not_all_same, hopper, is_win32, mark_if_feature_version, skip_unless_feature
label_desc: Use image node_id 1 for calling the TestRegistry obj's underlying member method code with example usage: obj.test_encode_registry() without return types