mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add testcase for specific build
This commit is contained in:
parent
12c614911a
commit
ac4ec47378
@ -7,6 +7,9 @@
|
||||
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from unittest.mock import Mock
|
||||
|
||||
import pytest
|
||||
from docutils import nodes
|
||||
|
||||
@ -113,3 +116,22 @@ def test_add_is_parallel_allowed(app, status, warning):
|
||||
"for parallel reading, assuming it isn't - please ") in warning.getvalue()
|
||||
app.extensions.pop('write_serial')
|
||||
warning.truncate(0) # reset warnings
|
||||
|
||||
|
||||
@pytest.mark.sphinx('dummy', testroot='root')
|
||||
def test_build_specific(app):
|
||||
app.builder.build = Mock()
|
||||
filenames = [app.srcdir / 'index.txt', # normal
|
||||
app.srcdir / 'images', # without suffix
|
||||
app.srcdir / 'notfound.txt', # not found
|
||||
app.srcdir / 'img.png', # unknown suffix
|
||||
'/index.txt', # external file
|
||||
app.srcdir / 'subdir', # directory
|
||||
app.srcdir / 'subdir/includes.txt', # file on subdir
|
||||
app.srcdir / 'subdir/../subdir/excluded.txt'] # not normalized
|
||||
app.build(False, filenames)
|
||||
|
||||
expected = ['index', 'images', 'img.png', 'subdir/includes', 'subdir/excluded']
|
||||
app.builder.build.assert_called_with(expected,
|
||||
method='specific',
|
||||
summary='5 source files given on command line')
|
||||
|
Loading…
Reference in New Issue
Block a user