Change mermaid integration test to avoid comparing received image (#7002)

This commit is contained in:
Silvano Cerza 2024-02-15 15:01:04 +01:00 committed by GitHub
parent 5a8d02064b
commit 06a9349095
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 12 deletions

View File

@ -1,9 +0,0 @@
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
@pytest.fixture
def test_files():
return Path(__file__).parent / "test_files"

View File

@ -16,15 +16,15 @@ from haystack.testing.sample_components import AddFixedValue, Double
@flaky.flaky(max_runs=5, rerun_filter=lambda *_: time.sleep(5))
@pytest.mark.integration
def test_to_mermaid_image(test_files):
def test_to_mermaid_image():
pipe = Pipeline()
pipe.add_component("comp1", Double())
pipe.add_component("comp2", Double())
pipe.connect("comp1", "comp2")
image_data = _to_mermaid_image(pipe.graph)
test_image = test_files / "test_mermaid_graph.png"
assert test_image.read_bytes() == image_data
# We just verify we received some data as testing the actual image is not reliable
assert image_data
@patch("haystack.core.pipeline.draw.requests")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB