code: def test_resize_wo_img(self):
      # keep_ratio = True
      dummy_result = dict(img_shape=(10, 20))
      resize = Resize(scale=(40, 30), keep_ratio=True)
      result = resize(dummy_result)
      self.assertEqual(result["img_shape"], (20, 40))
      self.assertEqual(result["scale"], (40, 20))
      self.assertEqual(result["scale_factor"], (2.0, 2.0))
      self.assertEqual(result["keep_ratio"], True)
  
      # keep_ratio = False
      dummy_result = dict(img_shape=(10, 20))
      resize = Resize(scale=(40, 30), keep_ratio=False)
      result = resize(dummy_result)
      self.assertEqual(result["img_shape"], (30, 40))
      self.assertEqual(result["scale"], (40, 30))
      self.assertEqual(
          result["scale_factor"],
          (
              2.0,
              3.0,
          ),
      )
      self.assertEqual(result["keep_ratio"], False)
  
imports: import copy
  import unittest
  import unittest.mock
  import numpy
  from mmocr.datasets.transforms import FixInvalidPolygon, RandomCrop, RandomRotate, RemoveIgnored, Resize
  from mmocr.utils import poly2shapely
label_desc: Use image node_id 1 for calling the TestResize obj's underlying member method code with example usage: obj.test_resize_wo_img() without return types