diff --git a/tests/roots/test-ext-graphviz/conf.py b/tests/roots/test-ext-graphviz/conf.py new file mode 100644 index 000000000..cecd53668 --- /dev/null +++ b/tests/roots/test-ext-graphviz/conf.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +extensions = ['sphinx.ext.graphviz'] +master_doc = 'index' diff --git a/tests/roots/test-ext-graphviz/index.rst b/tests/roots/test-ext-graphviz/index.rst new file mode 100644 index 000000000..39c755e9d --- /dev/null +++ b/tests/roots/test-ext-graphviz/index.rst @@ -0,0 +1,7 @@ +graphviz +======== + +.. digraph:: foo + :caption: caption of graph + + bar -> baz diff --git a/tests/test_ext_graphviz.py b/tests/test_ext_graphviz.py new file mode 100644 index 000000000..53f5be4df --- /dev/null +++ b/tests/test_ext_graphviz.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +""" + test_ext_graphviz + ~~~~~~~~~~~~~~~~~ + + Test sphinx.ext.graphviz extension. + + :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re +from util import with_app + + +@with_app('html', testroot='ext-graphviz') +def test_graphviz(app, status, warning): + app.builder.build_all() + if "dot command 'dot' cannot be run" not in warning.getvalue(): + content = (app.outdir / 'index.html').text() + html = ('

\s*\s*

\s*' + '

caption of graph') + assert re.search(html, content, re.S)