2017-03-07 14:10:23 +09:00
|
|
|
"""
|
|
|
|
|
test_ext_imgconverter
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
|
|
Test sphinx.ext.imgconverter extension.
|
|
|
|
|
|
2021-01-01 02:00:29 +09:00
|
|
|
:copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
|
2017-03-07 14:10:23 +09:00
|
|
|
:license: BSD, see LICENSE for details.
|
|
|
|
|
"""
|
|
|
|
|
|
2017-06-14 13:26:15 -05:00
|
|
|
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')
|
2017-06-14 13:26:15 -05:00
|
|
|
@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()
|
2021-04-17 16:51:19 +09:00
|
|
|
|
|
|
|
|
# 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()
|