Commit c8395c45 authored by Romain Casati's avatar Romain Casati

Testing Graphviz.

parent f8282a9c
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.40.1 (20161225.0304)
-->
<!-- Title: G Pages: 1 -->
<svg width="79pt" height="116pt"
viewBox="0.00 0.00 79.41 116.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 112)">
<title>G</title>
<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-112 75.4142,-112 75.4142,4 -4,4"/>
<!-- Hello -->
<g id="node1" class="node">
<title>Hello</title>
<ellipse fill="none" stroke="#000000" cx="35.7071" cy="-90" rx="32.4808" ry="18"/>
<text text-anchor="middle" x="35.7071" y="-85.8" font-family="Times,serif" font-size="14.00" fill="#000000">Hello</text>
</g>
<!-- World -->
<g id="node2" class="node">
<title>World</title>
<ellipse fill="none" stroke="#000000" cx="35.7071" cy="-18" rx="35.9154" ry="18"/>
<text text-anchor="middle" x="35.7071" y="-13.8" font-family="Times,serif" font-size="14.00" fill="#000000">World</text>
</g>
<!-- Hello&#45;&gt;World -->
<g id="edge1" class="edge">
<title>Hello&#45;&gt;World</title>
<path fill="none" stroke="#000000" d="M35.7071,-71.8314C35.7071,-64.131 35.7071,-54.9743 35.7071,-46.4166"/>
<polygon fill="#000000" stroke="#000000" points="39.2072,-46.4132 35.7071,-36.4133 32.2072,-46.4133 39.2072,-46.4132"/>
</g>
</g>
</svg>
......@@ -38,7 +38,22 @@ def test_folium(selenium):
def test_graphviz(selenium):
pass
result = selenium.run_basthon("""
from graphviz import Digraph
import basthon
g = Digraph('G')
g.edge('Hello', 'World')
basthon.display(g)
print(g.source)
""")
assert result['stderr'] == ""
assert result['stdout'] == "digraph G {\n\tHello -> World\n}\n"
assert result['display']['display_type'] == 'multiple'
svg = result['display']['content']['image/svg+xml']
with open(_test_data / "graphviz.svg") as f:
target = f.read()
assert target == svg
def test_p5(selenium):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment