Files
sphinx/tests/test_ext_imgconverter.py

30 lines
808 B
Python
Raw Normal View History

2017-03-07 14:10:23 +09:00
"""
test_ext_imgconverter
~~~~~~~~~~~~~~~~~~~~~
Test sphinx.ext.imgconverter extension.
:copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
2017-03-07 14:10:23 +09:00
:license: BSD, see LICENSE for details.
"""
import os
2017-03-07 14:10:23 +09:00
2018-02-19 22:39:14 +09:00
import pytest
2017-03-07 14:10:23 +09:00
@pytest.mark.sphinx('latex', testroot='ext-imgconverter')
@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows")
2017-03-07 14:10:23 +09:00
def test_ext_imgconverter(app, status, warning):
app.builder.build_all()
2020-02-01 11:58:51 +09:00
content = (app.outdir / 'python.tex').read_text()
# supported image (not converted)
assert '\\sphinxincludegraphics{{img}.pdf}' in content
# non supported image (converted)
2017-04-23 17:59:39 +09:00
assert '\\sphinxincludegraphics{{svgimg}.png}' in content
2017-03-07 14:10:23 +09:00
assert not (app.outdir / 'svgimg.svg').exists()
assert (app.outdir / 'svgimg.png').exists()