| 1 |
""" |
| 2 |
Tests of large and/or expensive graphs. |
| 3 |
""" |
| 4 |
|
| 5 |
import os |
| 6 |
import sys |
| 7 |
from pathlib import Path |
| 8 |
|
| 9 |
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../tests")) |
| 10 |
from gvtest import dot, run_raw # pylint: disable=wrong-import-position |
| 11 |
|
| 12 |
|
| 13 |
def test_long_chain(): |
| 14 |
""" |
| 15 |
This test will fail on 32bit Windows machine if compiled with stack size < 16MB. |
| 16 |
long_chain input file generated using code below: |
| 17 |
from graphviz import Digraph |
| 18 |
|
| 19 |
graph = Digraph(format="svg") |
| 20 |
|
| 21 |
prev = "start" |
| 22 |
graph.node("start", label="start") |
| 23 |
|
| 24 |
for i in range(33000): |
| 25 |
new_node = str(i) |
| 26 |
graph.node(new_node, label=new_node, shape="rectangle") |
| 27 |
|
| 28 |
graph.edge(prev, new_node) |
| 29 |
|
| 30 |
prev = new_node |
| 31 |
|
| 32 |
graph.render("long_chain") |
| 33 |
""" |
| 34 |
run_raw(["dot", "-Tsvg", "-o", os.devnull, Path(__file__).parent / "long_chain"]) |
| 35 |
|
| 36 |
|
| 37 |
def test_wide_clusters(): |
| 38 |
""" |
| 39 |
A simple regression test for https://gitlab.com/graphviz/graphviz/-/issues/2080# |
| 40 |
""" |
| 41 |
dot("svg", Path(__file__).parent / "wide_clusters") |