code: def test_default_component_from_dict_unregistered_component(request):
      # We use the test function name as component name to make sure it's not registered.
      # Since the registry is global we risk to have a component with the same name registered in another test.
      component_name = request.node.name
  
      with pytest.raises(
          DeserializationError,
          match=f"Class '{component_name}' can't be deserialized as 'Mock'",
      ):
          default_from_dict(Mock, {"type": component_name})
  
file_path: haystack/test/core/test_serialization.py
imports: import sys
  from unittest.mock import Mock
  import pytest
  from haystack.core.pipeline import Pipeline
  from haystack.core.component import component
  from haystack.core.errors import DeserializationError
  from haystack.testing import factory
  from haystack.core.serialization import default_to_dict, default_from_dict
label_desc: Use image node_id 5 for calling a global function with example usage: test_default_component_from_dict_unregistered_component(request) without return types