2012-03-11 11:48:51 -05:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
|
|
test_linkcode
|
|
|
|
~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
Test the sphinx.ext.linkcode extension.
|
|
|
|
|
2015-01-03 14:36:32 -06:00
|
|
|
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
|
2012-03-11 11:48:51 -05:00
|
|
|
:license: BSD, see LICENSE for details.
|
|
|
|
"""
|
|
|
|
|
|
|
|
import os
|
2013-04-01 04:39:32 -05:00
|
|
|
from util import with_app
|
2012-03-11 11:48:51 -05:00
|
|
|
|
2013-11-16 21:39:27 -06:00
|
|
|
|
2012-03-11 11:48:51 -05:00
|
|
|
@with_app(srcdir='(temp)', buildername='html', tags=['test_linkcode'])
|
|
|
|
def test_html(app):
|
|
|
|
app.builder.build_all()
|
|
|
|
|
2013-11-16 21:39:27 -06:00
|
|
|
stuff = (app.outdir / 'objects.html').text(encoding='utf-8')
|
2012-03-11 11:48:51 -05:00
|
|
|
|
|
|
|
assert 'http://foobar/source/foolib.py' in stuff
|
|
|
|
assert 'http://foobar/js/' in stuff
|
|
|
|
assert 'http://foobar/c/' in stuff
|
|
|
|
assert 'http://foobar/cpp/' in stuff
|