diff options
| author | Pauli Virtanen <pav@iki.fi> | 2012-03-11 17:48:51 +0100 |
|---|---|---|
| committer | Pauli Virtanen <pav@iki.fi> | 2012-03-11 17:48:51 +0100 |
| commit | e85f2467852ec4d42e4f4ed147bd64ef2907517d (patch) | |
| tree | 5c2fc418a1845dd24722b1e5917a35b45ea52bb0 /tests/test_linkcode.py | |
| parent | 3137157ebafefaedad02cfc780957b3adb59e826 (diff) | |
| download | sphinx-e85f2467852ec4d42e4f4ed147bd64ef2907517d.tar.gz | |
ENH: add a linkcode extension
Diffstat (limited to 'tests/test_linkcode.py')
| -rw-r--r-- | tests/test_linkcode.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test_linkcode.py b/tests/test_linkcode.py new file mode 100644 index 00000000..b4b33332 --- /dev/null +++ b/tests/test_linkcode.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +""" + test_linkcode + ~~~~~~~~~~~~~ + + Test the sphinx.ext.linkcode extension. + + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import os +from util import * + +@with_app(srcdir='(temp)', buildername='html', tags=['test_linkcode']) +def test_html(app): + app.builder.build_all() + + fp = open(os.path.join(app.outdir, 'objects.html'), 'rb') + try: + stuff = fp.read() + finally: + fp.close() + + 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 |
