Refactor test_build_html: Use basic project instead roots

This commit is contained in:
Takeshi KOMIYA 2017-12-15 02:30:09 +09:00
parent a5b64c98af
commit a3f04c3397

View File

@ -1114,16 +1114,22 @@ def test_html_assets(app):
assert not (app.outdir / 'subdir' / '.htpasswd').exists() assert not (app.outdir / 'subdir' / '.htpasswd').exists()
@pytest.mark.sphinx('html', confoverrides={'html_sourcelink_suffix': ''}) @pytest.mark.sphinx('html', testroot='basic', confoverrides={'html_sourcelink_suffix': '.txt'})
def test_html_sourcelink_suffix(app): def test_html_sourcelink_suffix(app):
app.builder.build_all() app.builder.build_all()
content_otherext = (app.outdir / 'otherext.html').text() assert (app.outdir / '_sources' / 'index.rst.txt').exists()
content_images = (app.outdir / 'images.html').text()
assert '<a href="_sources/otherext.foo"' in content_otherext
assert '<a href="_sources/images.txt"' in content_images @pytest.mark.sphinx('html', testroot='basic', confoverrides={'html_sourcelink_suffix': '.rst'})
assert (app.outdir / '_sources' / 'otherext.foo').exists() def test_html_sourcelink_suffix_same(app):
assert (app.outdir / '_sources' / 'images.txt').exists() app.builder.build_all()
assert (app.outdir / '_sources' / 'index.rst').exists()
@pytest.mark.sphinx('html', testroot='basic', confoverrides={'html_sourcelink_suffix': ''})
def test_html_sourcelink_suffix_empty(app):
app.builder.build_all()
assert (app.outdir / '_sources' / 'index.rst').exists()
@pytest.mark.sphinx('html', testroot='html_entity') @pytest.mark.sphinx('html', testroot='html_entity')