code: def test_dump_ocr_data(self):
      with tempfile.TemporaryDirectory() as tmpdir:
          output_path = osp.join(tmpdir, "ocr.json")
          (
              input_data,
              det_target,
              spotter_target,
              recog_target,
          ) = self._create_dummy_data()
  
          dump_ocr_data(input_data, output_path, "textdet")
          result = mmengine.load(output_path)
          self.assertDictEqual(result, det_target)
  
          dump_ocr_data(input_data, output_path, "textspotter")
          result = mmengine.load(output_path)
          self.assertDictEqual(result, spotter_target)
  
          dump_ocr_data(input_data, output_path, "textrecog")
          result = mmengine.load(output_path)
          self.assertDictEqual(result, recog_target)
  
file_path: mmocr/tests/test_utils/test_data_converter_utils.py
imports: import os.path
  import tempfile
  from unittest import TestCase
  import mmengine
  from mmocr.utils.data_converter_utils import dump_ocr_data, recog_anno_to_imginfo
label_desc: Use image node_id 2 for calling the TestDataConverterUtils obj's underlying member method code with example usage: obj.test_dump_ocr_data() without return types