mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add testcase for qthelp
This commit is contained in:
parent
fb8e258012
commit
f3b50ebef0
@ -14,15 +14,61 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.sphinx('qthelp', testroot='basic')
|
||||
def test_qthelp_basic(app, status, warning):
|
||||
app.builder.build_all()
|
||||
|
||||
qhcp = (app.outdir / 'Python.qhcp').text()
|
||||
assert '<title>Python documentation</title>' in qhcp
|
||||
assert '<homePage>qthelp://org.sphinx.python/doc/index.html</homePage>' in qhcp
|
||||
assert '<startPage>qthelp://org.sphinx.python/doc/index.html</startPage>' in qhcp
|
||||
assert '<input>Python.qhp</input>' in qhcp
|
||||
assert '<output>Python.qch</output>' in qhcp
|
||||
assert '<file>Python.qch</file>' in qhcp
|
||||
|
||||
|
||||
@pytest.mark.sphinx('qthelp', testroot='basic')
|
||||
def test_qthelp_namespace(app, status, warning):
|
||||
# default namespace
|
||||
app.builder.build_all()
|
||||
|
||||
qhp = (app.outdir / 'Python.qhp').text()
|
||||
assert '<namespace>org.sphinx.python</namespace>' in qhp
|
||||
|
||||
qhcp = (app.outdir / 'Python.qhcp').text()
|
||||
assert '<homePage>qthelp://org.sphinx.python/doc/index.html</homePage>' in qhcp
|
||||
assert '<startPage>qthelp://org.sphinx.python/doc/index.html</startPage>' in qhcp
|
||||
|
||||
# give a namespace
|
||||
app.config.qthelp_namespace = 'org.sphinx-doc.sphinx'
|
||||
app.builder.build_all()
|
||||
|
||||
qhp = (app.outdir / 'Python.qhp').text()
|
||||
assert '<namespace>org.sphinxdoc.sphinx</namespace>' in qhp
|
||||
|
||||
qhcp = (app.outdir / 'Python.qhcp').text()
|
||||
assert '<homePage>qthelp://org.sphinxdoc.sphinx/doc/index.html</homePage>' in qhcp
|
||||
assert '<startPage>qthelp://org.sphinxdoc.sphinx/doc/index.html</startPage>' in qhcp
|
||||
|
||||
|
||||
@pytest.mark.sphinx('qthelp', testroot='basic')
|
||||
def test_qthelp_title(app, status, warning):
|
||||
# default title
|
||||
app.builder.build_all()
|
||||
|
||||
qhp = (app.outdir / 'Python.qhp').text()
|
||||
assert '<section title="Python documentation" ref="index.html">' in qhp
|
||||
|
||||
qhcp = (app.outdir / 'Python.qhcp').text()
|
||||
assert '<title>Python documentation</title>' in qhcp
|
||||
|
||||
# give a title
|
||||
app.config.html_title = 'Sphinx <b>"full"</b> title'
|
||||
app.config.html_short_title = 'Sphinx <b>"short"</b> title'
|
||||
app.builder.build_all()
|
||||
|
||||
qhp = (app.outdir / 'Python.qhp').text()
|
||||
assert '<section title="Sphinx <b>"full"</b> title" ref="index.html">' in qhp
|
||||
|
||||
qhcp = (app.outdir / 'Python.qhcp').text()
|
||||
assert '<title>Sphinx <b>"short"</b> title</title>' in qhcp
|
||||
|
Loading…
Reference in New Issue
Block a user