2015-12-26 06:43:54 -06:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
|
|
test_toctree
|
|
|
|
~~~~~~~~~~~~
|
|
|
|
|
|
|
|
Test the HTML builder and check output against XPath.
|
|
|
|
|
2016-01-14 15:54:04 -06:00
|
|
|
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
|
2015-12-26 06:43:54 -06:00
|
|
|
:license: BSD, see LICENSE for details.
|
|
|
|
"""
|
|
|
|
|
|
|
|
from util import with_app
|
|
|
|
|
|
|
|
|
|
|
|
@with_app(testroot='toctree-glob')
|
|
|
|
def test_relations(app, status, warning):
|
|
|
|
app.builder.build_all()
|
|
|
|
assert app.builder.relations['index'] == [None, None, 'foo']
|
|
|
|
assert app.builder.relations['foo'] == ['index', 'index', 'bar/index']
|
|
|
|
assert app.builder.relations['bar/index'] == ['index', 'foo', 'bar/bar_1']
|
|
|
|
assert app.builder.relations['bar/bar_1'] == ['bar/index', 'bar/index', 'bar/bar_2']
|
|
|
|
assert app.builder.relations['bar/bar_2'] == ['bar/index', 'bar/bar_1', 'bar/bar_3']
|
2015-12-26 08:57:09 -06:00
|
|
|
assert app.builder.relations['bar/bar_3'] == ['bar/index', 'bar/bar_2', 'bar/bar_4/index']
|
|
|
|
assert app.builder.relations['bar/bar_4/index'] == ['bar/index', 'bar/bar_3', 'baz']
|
|
|
|
assert app.builder.relations['baz'] == ['index', 'bar/bar_4/index', 'qux/index']
|
|
|
|
assert app.builder.relations['qux/index'] == ['index', 'baz', 'qux/qux_1']
|
|
|
|
assert app.builder.relations['qux/qux_1'] == ['qux/index', 'qux/index', 'qux/qux_2']
|
|
|
|
assert app.builder.relations['qux/qux_2'] == ['qux/index', 'qux/qux_1', None]
|
|
|
|
assert 'quux' not in app.builder.relations
|