mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix typo
This commit is contained in:
parent
84e1eeb8a2
commit
7e23a061b3
@ -390,7 +390,7 @@ class BuildEnvironment:
|
||||
exclude_paths = (self.config.exclude_patterns +
|
||||
self.config.templates_path +
|
||||
builder.get_asset_paths())
|
||||
self.project.discovery(exclude_paths)
|
||||
self.project.discover(exclude_paths)
|
||||
|
||||
# Current implementation is applying translated messages in the reading
|
||||
# phase.Therefore, in order to apply the updated message catalog, it is
|
||||
|
@ -44,7 +44,7 @@ class Project(object):
|
||||
"""Take over a result of last build."""
|
||||
self.docnames = other.docnames
|
||||
|
||||
def discovery(self, exclude_paths=[]):
|
||||
def discover(self, exclude_paths=[]):
|
||||
# type: (List[unicode]) -> Set[unicode]
|
||||
"""Find all document files in the source directory and put them in
|
||||
:attr:`docnames`.
|
||||
|
@ -16,7 +16,7 @@ import pytest
|
||||
from sphinx.project import Project
|
||||
|
||||
|
||||
def test_project_discovery(rootdir):
|
||||
def test_project_discover(rootdir):
|
||||
project = Project(rootdir / 'test-root', {})
|
||||
|
||||
docnames = {'autodoc', 'bom', 'extapi', 'extensions', 'footnote', 'images',
|
||||
@ -26,29 +26,29 @@ def test_project_discovery(rootdir):
|
||||
|
||||
# basic case
|
||||
project.source_suffix = ['.txt']
|
||||
assert project.discovery() == docnames
|
||||
assert project.discover() == docnames
|
||||
|
||||
# exclude_paths option
|
||||
assert project.discovery(['subdir/*']) == docnames - subdir_docnames
|
||||
assert project.discover(['subdir/*']) == docnames - subdir_docnames
|
||||
|
||||
# exclude_patterns
|
||||
assert project.discovery(['.txt', 'subdir/*']) == docnames - subdir_docnames
|
||||
assert project.discover(['.txt', 'subdir/*']) == docnames - subdir_docnames
|
||||
|
||||
# multiple source_suffixes
|
||||
project.source_suffix = ['.txt', '.foo']
|
||||
assert project.discovery() == docnames | {'otherext'}
|
||||
assert project.discover() == docnames | {'otherext'}
|
||||
|
||||
# complicated source_suffix
|
||||
project.source_suffix = ['.foo.png']
|
||||
assert project.discovery() == {'img'}
|
||||
assert project.discover() == {'img'}
|
||||
|
||||
# templates_path
|
||||
project.source_suffix = ['.html']
|
||||
assert project.discovery() == {'_templates/layout',
|
||||
'_templates/customsb',
|
||||
'_templates/contentssb'}
|
||||
assert project.discover() == {'_templates/layout',
|
||||
'_templates/customsb',
|
||||
'_templates/contentssb'}
|
||||
|
||||
assert project.discovery(['_templates']) == set()
|
||||
assert project.discover(['_templates']) == set()
|
||||
|
||||
|
||||
@pytest.mark.sphinx(testroot='basic')
|
||||
|
Loading…
Reference in New Issue
Block a user