Debian Codegraph @

tests/test_ext_imgconverter/test_ext_imgmockconverter.py

raw
1 """Test image converter with identical basenames"""
2
3 from __future__ import annotations
4
5 from typing import TYPE_CHECKING
6
7 import pytest
8
9 if TYPE_CHECKING:
10 from sphinx.testing.util import SphinxTestApp
11
12
13 @pytest.mark.sphinx('latex', testroot='ext-imgmockconverter')
14 def test_ext_imgmockconverter(app: SphinxTestApp) -> None:
15 app.build(force_all=True)
16
17 content = (app.outdir / 'projectnamenotset.tex').read_text(encoding='utf8')
18
19 # check identical basenames give distinct files
20 assert '\\sphinxincludegraphics{{svgimg}.pdf}' in content
21 assert '\\sphinxincludegraphics{{svgimg1}.pdf}' in content
22 assert not (app.outdir / 'svgimg.svg').exists()
23 assert (app.outdir / 'svgimg.pdf').exists()
24 assert (app.outdir / 'svgimg1.pdf').exists()