File: test_complex_doc.py

package info (click to toggle)
sphinx-needs 5.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 11,924 kB
  • sloc: python: 21,132; javascript: 187; makefile: 89; sh: 29; xml: 10
file content (34 lines) | stat: -rw-r--r-- 848 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""
Tests a more complex documentation project with different Sphinx-Needs features on different builders and in parallel
mode.
"""

from pathlib import Path

import pytest


@pytest.mark.parametrize(
    "test_app",
    [{"buildername": "latex", "srcdir": "doc_test/doc_complex"}],
    indirect=True,
)
def test_doc_complex_latex(test_app):
    app = test_app
    app.build()
    tex = Path(app.outdir, "basictest.tex").read_text(encoding="utf8")

    assert "Test story" in tex  # PlantUML got generated


@pytest.mark.parametrize(
    "test_app",
    [{"buildername": "singlehtml", "srcdir": "doc_test/doc_complex"}],
    indirect=True,
)
def test_doc_complex_singlehtml(test_app):
    app = test_app
    app.build()
    html = Path(app.outdir, "index.html").read_text(encoding="utf8")

    assert "Test story" in html  # PlantUML got generated