#2575: Now `sphinx.ext.graphviz allows :align:` option

This commit is contained in:
Takeshi KOMIYA
2016-05-28 18:29:10 +09:00
parent e3be266be3
commit 1d17475a08
5 changed files with 48 additions and 0 deletions
+6
View File
@@ -19,3 +19,9 @@ Hello |graph| graphviz world
.. graphviz:: graph.dot
.. digraph:: bar
:align: right
:caption: on right
foo -> bar
+9
View File
@@ -55,6 +55,10 @@ def test_graphviz_html(app, status, warning):
html = '<img src=".*?" alt="digraph {\n bar -&gt; baz\n}" />'
assert re.search(html, content, re.M)
html = ('<div class="figure align-right" .*?>\s*<img .*?/>\s*<p class="caption">'
'<span class="caption-text">on right</span>.*</p>\s*</div>')
assert re.search(html, content, re.S)
@with_app('latex', testroot='ext-graphviz')
@skip_if_graphviz_not_found
@@ -70,6 +74,11 @@ def test_graphviz_latex(app, status, warning):
macro = 'Hello \\\\includegraphics{graphviz-\w+.pdf} graphviz world'
assert re.search(macro, content, re.S)
macro = ('\\\\begin{wrapfigure}{r}{0pt}\n\\\\centering\n'
'\\\\includegraphics{graphviz-\w+.pdf}\n'
'\\\\caption{on right}\\\\label{.*}\\\\end{wrapfigure}')
assert re.search(macro, content, re.S)
@with_app('html', testroot='ext-graphviz', confoverrides={'language': 'xx'})
@skip_if_graphviz_not_found