Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
jfbu committed Aug 13, 2024
1 parent 7f633d8 commit 6e6ec19
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
Empty file.
19 changes: 19 additions & 0 deletions tests/roots/test-latex-contents-topic-sidebar/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
test-contents-et-al
===================

.. contents::

test-topic
----------

.. topic:: Title of topic

text of topic

test-sidebar
------------

.. sidebar:: Title of sidebar
:subtitle: sub-title

text of sidebar
30 changes: 30 additions & 0 deletions tests/test_builders/test_build_latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -2272,3 +2272,33 @@ def test_latex_rubric(app):
content = (app.outdir / 'test.tex').read_text(encoding='utf8')
assert r'\subsubsection*{This is a rubric}' in content
assert r'\subsection*{A rubric with a heading level 2}' in content


@pytest.mark.sphinx('latex',testroot='latex-contents-topic-sidebar')
def test_latex_contents_topic_sidebar(app):
app.build()

Check failure on line 2279 in tests/test_builders/test_build_latex.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E231)

tests/test_builders/test_build_latex.py:2279:28: E231 Missing whitespace after ','
result = (app.outdir / 'projectnamenotset.tex').read_text(encoding='utf8')

assert (
'\\begin{sphinxcontents}\n'
'\\sphinxstylecontentstitle{Contents}\n'
) in result

assert (
'\\begin{sphinxtopic}\n'
'\\sphinxstyletopictitle{Title of topic}\n'
'\n'
'\\sphinxAtStartPar\n'
'text of topic\n'
'\\end{sphinxtopic}\n'
) in result

assert (
'\\begin{sphinxsidebar}\n'
'\\sphinxstylesidebartitle{Title of sidebar}\n'
'\\sphinxstylesidebarsubtitle{sub\\sphinxhyphen{}title}\n'
'\n'
'\\sphinxAtStartPar\n'
'text of sidebar\n'
'\\end{sphinxsidebar}\n'
) in result

0 comments on commit 6e6ec19

Please sign in to comment.