test: Use get_doctree() to load doctree files

This commit is contained in:
Takeshi KOMIYA
2019-02-17 19:52:08 +09:00
parent 63ccc34475
commit 90bf81bd37
4 changed files with 18 additions and 25 deletions

View File

@@ -8,7 +8,6 @@
:license: BSD, see LICENSE for details.
"""
import pickle
import sys
from textwrap import dedent
@@ -110,7 +109,7 @@ def test_image_glob(app, status, warning):
app.builder.build_all()
# index.rst
doctree = pickle.loads((app.doctreedir / 'index.doctree').bytes())
doctree = app.env.get_doctree('index')
assert isinstance(doctree[0][1], nodes.image)
assert doctree[0][1]['candidates'] == {'*': 'rimg.png'}
@@ -135,7 +134,7 @@ def test_image_glob(app, status, warning):
assert doctree[0][4][0]['uri'] == 'img.*'
# subdir/index.rst
doctree = pickle.loads((app.doctreedir / 'subdir/index.doctree').bytes())
doctree = app.env.get_doctree('subdir/index')
assert isinstance(doctree[0][1], nodes.image)
sub = path('subdir')