code: def test_register_box_converter(self):
      @register_box("A")
      class A(ToyBaseBoxes):
          pass
  
      @register_box("B")
      class B(ToyBaseBoxes):
          pass
  
      @register_box("C")
      class C(ToyBaseBoxes):
          pass
  
      # test usage of decorator
      @register_box_converter("A", "B")
      def converter_A(bboxes):
          return bboxes
  
      # test usage of normal function
      def converter_B(bboxes):
          return bboxes
  
      register_box_converter("B" "A", converter_B)
  
      # register uncallable object
      with self.assertRaises(AssertionError):
          register_box_converter("A", "C", "uncallable str")
  
      # test register unregistered bbox mode
      with self.assertRaises(AssertionError):
  
          @register_box_converter("A", "D")
          def converter_C(bboxes):
              return bboxes
  
      # test register registered converter
      with self.assertRaises(KeyError):
  
          @register_box_converter("A", "B")
          def converter_D(bboxes):
              return bboxes
  
      @register_box_converter("A", "B", force=True)
      def converter_E(bboxes):
          return bboxes
  
      self.assertIs(box_converters["a2b"], converter_E)
  
file_path: mmdetection/tests/test_structures/test_bbox/test_box_type.py
imports: from unittest import TestCase
  from unittest.mock import MagicMock
  import torch
  from mmdet.structures.bbox.box_type import _box_type_to_name, box_converters, box_types, convert_box_type, get_box_type, register_box, register_box_converter
  from .utils import ToyBaseBoxes
label_desc: Use image node_id 4 for calling the TestBoxType obj's underlying member method code with example usage: obj.test_register_box_converter() and returns: bboxes, bboxes, bboxes, bboxes, bboxes