2013-12-27 05:23:47 +00:00
|
|
|
"""
|
|
|
|
|
test_templating
|
|
|
|
|
~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
|
|
Test templating.
|
|
|
|
|
|
2019-01-02 16:00:30 +09:00
|
|
|
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
|
2013-12-27 05:23:47 +00:00
|
|
|
:license: BSD, see LICENSE for details.
|
|
|
|
|
"""
|
|
|
|
|
|
2017-01-06 01:14:47 +09:00
|
|
|
import pytest
|
2018-02-19 22:39:14 +09:00
|
|
|
|
2017-06-18 10:25:34 +09:00
|
|
|
from sphinx.ext.autosummary.generate import setup_documenters
|
2013-12-27 05:23:47 +00:00
|
|
|
|
|
|
|
|
|
2017-01-06 01:14:47 +09:00
|
|
|
@pytest.mark.sphinx('html', testroot='templating')
|
2017-06-18 10:25:34 +09:00
|
|
|
def test_layout_overloading(make_app, app_params):
|
|
|
|
|
args, kwargs = app_params
|
|
|
|
|
app = make_app(*args, **kwargs)
|
2018-01-07 00:05:48 +09:00
|
|
|
setup_documenters(app)
|
2014-09-21 17:17:02 +02:00
|
|
|
app.builder.build_update()
|
2013-12-27 05:23:47 +00:00
|
|
|
|
2019-01-02 22:39:06 +09:00
|
|
|
result = (app.outdir / 'index.html').text()
|
2013-12-27 05:23:47 +00:00
|
|
|
assert '<!-- layout overloading -->' in result
|
|
|
|
|
|
|
|
|
|
|
2017-01-06 01:14:47 +09:00
|
|
|
@pytest.mark.sphinx('html', testroot='templating')
|
2017-06-18 10:25:34 +09:00
|
|
|
def test_autosummary_class_template_overloading(make_app, app_params):
|
|
|
|
|
args, kwargs = app_params
|
|
|
|
|
app = make_app(*args, **kwargs)
|
2018-01-07 00:05:48 +09:00
|
|
|
setup_documenters(app)
|
2014-09-21 17:17:02 +02:00
|
|
|
app.builder.build_update()
|
2013-12-27 05:23:47 +00:00
|
|
|
|
2019-01-02 22:39:06 +09:00
|
|
|
result = (app.outdir / 'generated' / 'sphinx.application.TemplateBridge.html').text()
|
2013-12-27 05:23:47 +00:00
|
|
|
assert 'autosummary/class.rst method block overloading' in result
|