code: def test_call_raises_error_when_there_are_leftover_overrides(
      self,
  ) -> None:
      obj = Foo1(
          a=1, b="b", c=Foo2(x=2, y="foo3"), d=Foo2(x=3, y="foo3")
      )
  
      overrides = {"b": "a", "c": {"y": "foo4", "z": 2}, "e": 4}
  
      with pytest.raises(
          ValueError,
          match=r"^The following keys contained in `overrides` do not exist in `obj`: \['c\.z', 'e'\]$",
      ):
          update_dataclass(obj, overrides)
  
      assert obj == Foo1(
          a=1, b="a", c=Foo2(x=2, y="foo4"), d=Foo2(x=3, y="foo3")
      )
  
file_path: fairseq2/tests/unit/utils/test_dataclass.py
imports: from dataclasses import dataclass
  from typing import Optional
  import pytest
  from fairseq2.utils.dataclass import update_dataclass
label_desc: Use image node_id 5 for calling the TestUpdateClassFunction obj's underlying member method code with example usage: obj.test_call_raises_error_when_there_are_leftover_overrides() without return types