mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-12-26 14:38:36 +00:00
Change mermaid integration test to avoid comparing received image (#7002)
This commit is contained in:
parent
5a8d02064b
commit
06a9349095
@ -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"
|
||||
@ -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 |
Loading…
x
Reference in New Issue
Block a user