code: def test_init(self):
      # Decoder is not allowed to be None
      with self.assertRaises(AssertionError):
          EncoderDecoderRecognizer()
  
      for attr in ["backbone", "preprocessor", "encoder"]:
          recognizer = EncoderDecoderRecognizer(
              **{
                  attr: dict(type="DummyModule", value=1),
                  "decoder": dict(type="DummyModule", value=2),
              }
          )
          self.assertTrue(hasattr(recognizer, attr))
          self.assertFalse(
              any(
                  hasattr(recognizer, t)
                  for t in ["backbone", "preprocessor", "encoder"]
                  if t != attr
              )
          )
  
file_path: mmocr/tests/test_models/test_textrecog/test_recognizers/test_encoder_decoder_recognizer.py
imports: from unittest import TestCase
  import torch
  from mmocr.models.textrecog.recognizers import EncoderDecoderRecognizer
  from mmocr.registry import MODELS
label_desc: Use image node_id 1 for calling the TestEncoderDecoderRecognizer obj's underlying member method code with example usage: obj.test_init() without return types