mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
`html_static_path` can now contain single file entries.
Exclusion of static path files is not yet implemented. HG: Bitte gib eine Versions-Meldung ein. Zeilen beginnend mit 'HG:' werden entfernt. HG: Leere Versionsmeldung wird das Übernehmen abbrechen. HG: -- HG: Benutzer: Georg Brandl <georg@python.org> HG: branch 'default' HG: added tests/root/_static/excluded.css HG: added tests/root/_static/subdir/foo.css HG: added tests/root/templated.css_t HG: Geändert CHANGES HG: Geändert doc/config.rst HG: Geändert sphinx/builders/html.py HG: Geändert sphinx/util/__init__.py HG: Geändert tests/root/_static/README HG: Geändert tests/root/conf.py HG: Geändert tests/test_build_html.py
This commit is contained in:
@@ -11,7 +11,6 @@
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import difflib
|
||||
import htmlentitydefs
|
||||
from StringIO import StringIO
|
||||
@@ -21,8 +20,7 @@ try:
|
||||
except ImportError:
|
||||
pygments = None
|
||||
|
||||
from sphinx.builders.html import StandaloneHTMLBuilder
|
||||
|
||||
from sphinx import __version__
|
||||
from util import *
|
||||
from test_build import ENV_WARNINGS
|
||||
from etree13 import ElementTree as ET
|
||||
@@ -169,6 +167,19 @@ def check_xpath(etree, fname, path, check):
|
||||
'path %s in %s: %r' % (check, path, fname,
|
||||
[node.text for node in nodes]))
|
||||
|
||||
def check_static_entries(outdir):
|
||||
staticdir = outdir / '_static'
|
||||
assert staticdir.isdir()
|
||||
# a file from a directory entry in html_static_path
|
||||
assert (staticdir / 'README').isfile()
|
||||
# a directory from a directory entry in html_static_path
|
||||
assert (staticdir / 'subdir' / 'foo.css').isfile()
|
||||
# a file from a file entry in html_static_path
|
||||
assert (staticdir / 'templated.css').isfile()
|
||||
assert (staticdir / 'templated.css').text().splitlines()[1] == __version__
|
||||
# a file from _static, but matches exclude_patterns
|
||||
##assert not (staticdir / 'excluded.css').exists()
|
||||
|
||||
@gen_with_app(buildername='html', warning=html_warnfile, cleanenv=True,
|
||||
confoverrides={'html_context.hckey_co': 'hcval_co'},
|
||||
tags=['testtag'])
|
||||
@@ -186,3 +197,5 @@ def test_html(app):
|
||||
etree = ET.parse(os.path.join(app.outdir, fname), parser)
|
||||
for path, check in paths.iteritems():
|
||||
yield check_xpath, etree, fname, path, check
|
||||
|
||||
check_static_entries(app.builder.outdir)
|
||||
|
||||
Reference in New Issue
Block a user