File: test_backrefs.py

package info (click to toggle)
sphinxcontrib-bibtex 2.6.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,140 kB
  • sloc: python: 4,668; makefile: 245
file content (35 lines) | stat: -rw-r--r-- 1,275 bytes parent folder | download | duplicates (2)
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
35
"""Test back references."""

from test.common import html_citations

import pytest


@pytest.mark.sphinx("html", testroot="backrefs")
def test_backrefs(app, warning) -> None:
    app.build()
    output = (app.outdir / "index.html").read_text()
    match = html_citations(text=".*Test zero.*").search(output)
    assert match
    assert match.group("backref") is None
    assert match.group("backref1") is None
    assert match.group("backref2") is None
    assert match.group("backref3") is None
    match = html_citations(text=".*Test one.*").search(output)
    assert match
    assert match.group("backref") is not None
    assert match.group("backref1") is None
    assert match.group("backref2") is None
    assert match.group("backref3") is None
    match = html_citations(text=".*Test two.*").search(output)
    assert match
    assert match.group("backref") is None
    assert match.group("backref1") is not None
    assert match.group("backref2") is not None
    assert match.group("backref3") is None
    match = html_citations(text=".*Test three.*").search(output)
    assert match
    assert match.group("backref") is None
    assert match.group("backref1") is not None
    assert match.group("backref2") is not None
    assert match.group("backref3") is not None