code: def test_input_has_default_value():
      @component
      class MockComponent:
          @component.output_types(value=int)
          def run(self, value: int = 42):
              return {"value": value}
  
      comp = MockComponent()
      assert comp.__canals_input__["value"].default_value == 42
      assert not comp.__canals_input__["value"].is_mandatory
  
file_path: haystack/test/core/component/test_component.py
imports: import typing
  from typing import Any, Optional
  import pytest
  from haystack.core.component import component
  from haystack.core.errors import ComponentError
  from haystack.core.component import InputSocket, OutputSocket, Component
label_desc: Use image node_id 9 for calling a global function with example usage: test_input_has_default_value() and returns: dict