diff --git a/tests/roots/test-manpage_url/index.rst b/tests/roots/test-manpage_url/index.rst index 252851baa..6761f97a8 100644 --- a/tests/roots/test-manpage_url/index.rst +++ b/tests/roots/test-manpage_url/index.rst @@ -1,5 +1,7 @@ - * :manpage:`man(1)` - * :manpage:`ls.1` - * :manpage:`sphinx` - * :manpage:`mailx(1) ` - * :manpage:`!man(1)` +The :manpage:`cp(1)` +-------------------- +* :manpage:`man(1)` +* :manpage:`ls.1` +* :manpage:`sphinx` +* :manpage:`mailx(1) ` +* :manpage:`!man(1)` diff --git a/tests/test_builders/test_build_html.py b/tests/test_builders/test_build_html.py index a9f785746..7c6d7e868 100644 --- a/tests/test_builders/test_build_html.py +++ b/tests/test_builders/test_build_html.py @@ -293,6 +293,20 @@ def test_html_sidebar(app, status, warning): assert ctx['sidebars'] == [] +@pytest.mark.parametrize(("fname", "expect"), [ + ('index.html', (".//h1/em/a[@href='https://example.com/cp.1']", '', True)), + ('index.html', (".//em/a[@href='https://example.com/man.1']", '', True)), + ('index.html', (".//em/a[@href='https://example.com/ls.1']", '', True)), + ('index.html', (".//em/a[@href='https://example.com/sphinx.']", '', True)), +]) +@pytest.mark.sphinx('html', testroot='manpage_url', confoverrides={ + 'manpages_url': 'https://example.com/{page}.{section}'}) +@pytest.mark.test_params(shared_result='test_build_html_manpage_url') +def test_html_manpage(app, cached_etree_parse, fname, expect): + app.build() + check_xpath(cached_etree_parse(app.outdir / fname), fname, *expect) + + @pytest.mark.sphinx('html', testroot='toctree-glob', confoverrides={'html_baseurl': 'https://example.com/'}) def test_html_baseurl(app, status, warning):