code: def test_init(self):
      cfg = dict(type="Tmp")
      tmp_dir = tempfile.TemporaryDirectory()
      dict_file = osp.join(tmp_dir.name, "fake_chars.txt")
      create_dummy_dict_file(dict_file)
      # test diction cfg
      dict_cfg = dict(
          type="Dictionary",
          dict_file=dict_file,
          with_start=True,
          with_end=True,
          same_start_end=False,
          with_padding=True,
          with_unknown=True,
      )
      with self.assertRaises(AssertionError):
          BaseDecoder(dict_cfg, [], cfg)
      with self.assertRaises(AssertionError):
          BaseDecoder(dict_cfg, cfg, [])
      with self.assertRaises(TypeError):
          BaseDecoder([], cfg, cfg)
      decoder = BaseDecoder(dictionary=dict_cfg)
      self.assertIsNone(decoder.module_loss)
      self.assertIsNone(decoder.postprocessor)
      self.assertIsInstance(decoder.dictionary, Dictionary)
      decoder = BaseDecoder(dict_cfg, cfg, cfg)
      self.assertIsInstance(decoder.module_loss, Tmp)
      self.assertIsInstance(decoder.postprocessor, Tmp)
      dictionary = TASK_UTILS.build(dict_cfg)
      decoder = BaseDecoder(dictionary, cfg, cfg)
      self.assertIsInstance(decoder.dictionary, Dictionary)
      tmp_dir.cleanup()
  
file_path: mmocr/tests/test_models/test_textrecog/test_decoders/test_base_decoder.py
imports: import os.path
  import tempfile
  from unittest import TestCase, mock
  from mmocr.models.common.dictionary import Dictionary
  from mmocr.models.textrecog.decoders import BaseDecoder
  from mmocr.registry import MODELS, TASK_UTILS
  from mmocr.testing import create_dummy_dict_file
label_desc: Use image node_id 1 for calling the TestBaseDecoder obj's underlying member method code with example usage: obj.test_init() without return types