code: def test_draw_mermaid_img_failing_request(tmp_path):
      pipe = Pipeline()
      pipe.add_component("comp1", Double())
      pipe.add_component("comp2", Double())
      pipe.connect("comp1", "comp2")
      pipe.connect("comp2", "comp1")
  
      with patch(
          "haystack.core.pipeline.draw.mermaid.requests.get"
      ) as mock_get:
  
          def raise_for_status(self):
              raise requests.HTTPError()
  
          mock_response = MagicMock()
          mock_response.status_code = 429
          mock_response.content = '{"error": "too many requests"}'
          mock_response.raise_for_status = raise_for_status
          mock_get.return_value = mock_response
  
          with pytest.raises(
              PipelineDrawingError,
              match="There was an issue with https://mermaid.ink/",
          ):
              _draw(
                  pipe.graph,
                  tmp_path / "test_pipe.jpg",
                  engine="mermaid-image",
              )
  
file_path: haystack/test/core/pipeline/test_draw.py
imports: import os
  import filecmp
  from unittest.mock import patch, MagicMock
  import pytest
  import requests
  from haystack.core.pipeline import Pipeline
  from haystack.core.pipeline.draw.draw import _draw, _convert
  from haystack.core.errors import PipelineDrawingError
  from haystack.testing.sample_components import Double, AddFixedValue
label_desc: Use image node_id 2 for calling a global function with example usage: test_draw_mermaid_img_failing_request(tmp_path) without return types