code: def test_postprocess(self):
      # return_datasample
      img_path = "tests/data/rec_toy_dataset/imgs/1036169.jpg"
      res = self.inferencer(img_path, return_datasamples=True)
      self.assertTrue(
          is_type_list(res["predictions"], TextRecogDataSample)
      )
  
      # pred_out_file
      with tempfile.TemporaryDirectory() as tmp_dir:
          res = self.inferencer(
              img_path,
              print_result=True,
              out_dir=tmp_dir,
              save_pred=True,
          )
          dumped_res = mmengine.load(
              osp.join(tmp_dir, "preds", "1036169.json")
          )
          self.assert_prediction_equal(
              res["predictions"][0], dumped_res
          )
  
file_path: mmocr/tests/test_apis/test_inferencers/test_textrec_inferencer.py
imports: import os.path
  import random
  import tempfile
  from unittest import TestCase, mock
  import mmcv
  import mmengine
  import numpy
  import torch
  from mmocr.apis.inferencers import TextRecInferencer
  from mmocr.utils.check_argument import is_type_list
  from mmocr.utils.typing_utils import TextRecogDataSample
label_desc: Use image node_id 7 for calling the TestTextRecinferencer obj's underlying member method code with example usage: obj.test_postprocess() without return types