code: def test_pipeline_dump(pipeline, test_files_path, tmp_path):
      pipeline.add_component("Comp1", TestComponent("Foo"))
      pipeline.add_component("Comp2", TestComponent())
      pipeline.connect("Comp1.value", "Comp2.input_")
      pipeline.max_loops_allowed = 99
      with open(tmp_path / "out.yaml", "w") as f:
          pipeline.dump(f)
      # re-open and ensure it's the same data as the test file
      with open(
          f"{test_files_path}/yaml/test_pipeline.yaml", "r"
      ) as test_f, open(tmp_path / "out.yaml", "r") as f:
          assert f.read() == test_f.read()
  
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 4 for calling a global function with example usage: test_pipeline_dump(pipeline, test_files_path, tmp_path) without return types