code: def testDeprecationClass(self):
      class MyClass1:
          __init__ = mock.MagicMock()
  
      class MyClass2:
          __init__ = mock.MagicMock()
  
      # By default, we warn once across all calls.
      DeprecatedAliasClass1 = deprecation_utils.deprecated_alias(  # pylint: disable=invalid-name
          "DeprecatedAliasClass1", "MyClass1", MyClass1
      )
      DeprecatedAliasClass1()
      DeprecatedAliasClass1()
      self._assertDeprecatedWarningRegex(
          "From .*: The name DeprecatedAliasClass1 is deprecated. Please use "
          "MyClass1 instead."
      )
      self.assertEqual(MyClass1.__init__.call_count, 2)
      self._mock_warn.reset_mock()
  
      # Check properties of the deprecated class.
      self.assertEqual(
          DeprecatedAliasClass1.__name__, "_NewDeprecatedClass"
      )
      self.assertEqual(
          repr(DeprecatedAliasClass1.__doc__),
          repr(
              """DEPRECATED CLASS
  
  Warning: THIS CLASS IS DEPRECATED. It will be removed in a future version.
  Please use MyClass1 instead."""
          ),
      )
  
      # If `warn_once=False`, we warn once for each call.
      DeprecatedAliasClass2 = deprecation_utils.deprecated_alias(  # pylint: disable=invalid-name
          "DeprecatedAliasClass2", "MyClass2", MyClass2, warn_once=False
      )
      DeprecatedAliasClass2()
      DeprecatedAliasClass2()
      DeprecatedAliasClass2()
      self.assertEqual(self._mock_warn.call_count, 3)
      self.assertEqual(MyClass2.__init__.call_count, 3)
  
file_path: tfx/tfx/utils/deprecation_utils_test.py
imports: from unittest import mock
  import tensorflow
  from tfx.utils import deprecation_utils
  from tfx.utils import test_case_utils
label_desc: Use image node_id 6 for calling the DependencyUtilsTest obj's underlying member method code with example usage: obj.testDeprecationClass() without return types