code: def test_transform(self, mock_randint):
      def rand_min(low, high):
          return low
  
      # mock_randint.side_effect = [0, 0, 0, 0, 30, 0, 0, 0, 15]
      mock_randint.side_effect = rand_min
      trans = RandomCrop(min_side_ratio=0.3)
      polygon_target = np.array(
          [5.0, 5.0, 25.0, 5.0, 25.0, 10.0, 5.0, 10.0]
      )
      bbox_target = np.array([[5.0, 5.0, 25.0, 10.0]])
      results = trans(self.data_info)
  
      self.assertEqual(results["img"].shape, (10, 25, 3))
      self.assertEqual(results["img_shape"], (10, 25))
      self.assertTrue(np.allclose(results["gt_bboxes"], bbox_target))
      self.assertEqual(results["gt_bboxes"].shape, (1, 4))
      self.assertEqual(len(results["gt_polygons"]), 1)
      self.assertTrue(
          np.allclose(results["gt_polygons"][0], polygon_target)
      )
      self.assertEqual(results["gt_bboxes_labels"][0], 0)
      self.assertEqual(results["gt_ignored"][0], True)
      self.assertEqual(results["gt_texts"][0], "text1")
  
      def rand_max(low, high):
          return high - 1
  
      mock_randint.side_effect = rand_max
      trans = RandomCrop(min_side_ratio=0.3)
      polygon_target = np.array([1, 1, 21, 1, 21, 6, 1, 6])
      bbox_target = np.array([[1, 1, 21, 6]])
      results = trans(self.data_info)
  
      self.assertEqual(results["img"].shape, (6, 21, 3))
      self.assertEqual(results["img_shape"], (6, 21))
      self.assertTrue(np.allclose(results["gt_bboxes"], bbox_target))
      self.assertEqual(results["gt_bboxes"].shape, (1, 4))
      self.assertEqual(len(results["gt_polygons"]), 1)
      self.assertTrue(
          np.allclose(results["gt_polygons"][0], polygon_target)
      )
      self.assertEqual(results["gt_bboxes_labels"][0], 0)
      self.assertTrue(results["gt_ignored"][0])
      self.assertEqual(results["gt_texts"][0], "text1")
  
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 3 for calling the TestRandomCrop obj's underlying member method code with example usage: obj.test_transform(mock_randint) and returns: low, unknown