code: def test_pipeline_dumps(pipeline, test_files_path):
      pipeline.add_component("Comp1", TestComponent("Foo"))
      pipeline.add_component("Comp2", TestComponent())
      pipeline.connect("Comp1.value", "Comp2.input_")
      pipeline.max_loops_allowed = 99
      result = pipeline.dumps()
      with open(f"{test_files_path}/yaml/test_pipeline.yaml", "r") as f:
          assert f.read() == result
  
file_path: haystack/test/test_pipeline.py
imports: from typing import Optional
  import pytest
  from haystack import Pipeline, component
label_desc: Use image node_id 2 for calling a global function with example usage: test_pipeline_dumps(pipeline, test_files_path) without return types