Debian Codegraph @

docs/tests/test_python_igraph_docs.py

raw
1 #
2 # Run tests after python-igraph's documentation is executed.
3 #
4 # These tests are designed to be executed inside tox, after pydoctor is run.
5 # Alternatively this can be excuted manually from the project root folder like:
6 # pytest docs/tests/test_python_igraph_docs.py
7
8 from . import get_toxworkdir_subdir
9
10 BASE_DIR = get_toxworkdir_subdir('python-igraph-output')
11
12 def test_python_igraph_docs() -> None:
13 """
14 Test for https://github.com/twisted/pydoctor/issues/287
15 """
16
17 with open(BASE_DIR / 'igraph.html') as stream:
18 page = stream.read()
19 assert all(impl in page for impl in ['href="igraph._igraph.html"']), page
20
21 with open(BASE_DIR / 'igraph.Graph.html') as stream:
22 page = stream.read()
23 assert all(impl in page for impl in ['href="igraph.GraphBase.html"']), page
24
25 with open(BASE_DIR / 'igraph.GraphBase.html') as stream:
26 page = stream.read()
27 assert all(impl in page for impl in ['href="igraph.Graph.html"']), page