docstr: Test deprecated arg default, where the decorator is wrongly used.
docstr_tok: ["Test","deprecated","arg","default",",","where","the","decorator","is","wrongly","used","."]
code: def test_deprecated_arg_default_errors(self):
      """
      Test deprecated arg default, where the decorator is wrongly used.
      """
  
      # since > replaced
      def since_grater_than_replaced():
          @deprecated_arg_default(
              "b",
              old_default="a",
              new_default="b",
              since=self.test_version,
              replaced=self.prev_version,
              version_val=self.test_version,
          )
          def foo(a, b=None):
              return a, b
  
      self.assertRaises(ValueError, since_grater_than_replaced)
  
      # argname doesnt exist
      def argname_doesnt_exist():
          @deprecated_arg_default(
              "other",
              old_default="a",
              new_default="b",
              since=self.test_version,
              version_val=self.test_version,
          )
          def foo(a, b=None):
              return a, b
  
      self.assertRaises(ValueError, argname_doesnt_exist)
  
      # argname has no default
      def argname_has_no_default():
          @deprecated_arg_default(
              "a",
              old_default="a",
              new_default="b",
              since=self.prev_version,
              replaced=self.test_version,
              version_val=self.test_version,
          )
          def foo(a):
              return a
  
      self.assertRaises(ValueError, argname_has_no_default)
  
      # new default is used but version < replaced
      def argname_was_replaced_before_specified_version():
          @deprecated_arg_default(
              "a",
              old_default="a",
              new_default="b",
              since=self.prev_version,
              replaced=self.next_version,
              version_val=self.test_version,
          )
          def foo(a, b="b"):
              return a, b
  
      self.assertRaises(
          ValueError, argname_was_replaced_before_specified_version
      )
  
imports: from __future__ import annotations
  import unittest
  import warnings
  from monai.utils import DeprecatedError, deprecated, deprecated_arg, deprecated_arg_default
label_desc: Use image node_id 28 for calling the TestDeprecated obj's underlying member method code with example usage: obj.test_deprecated_arg_default_errors() and returns: a,  b, a,  b, a, a,  b