summaryrefslogtreecommitdiff
path: root/tests/test_search.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-01-25 22:26:19 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-02-22 17:34:44 +0900
commit30b0361f9cef44316a3a720551084dc7efbe1fd3 (patch)
tree08b36dbb0b63c2f754b203b02a76e1f701975452 /tests/test_search.py
parent56eca39cbb378544efbbba930829cd6f0ac318ef (diff)
downloadsphinx-git-30b0361f9cef44316a3a720551084dc7efbe1fd3.tar.gz
Close #7025: html search: full text search can be disabled via metadata
Diffstat (limited to 'tests/test_search.py')
-rw-r--r--tests/test_search.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/test_search.py b/tests/test_search.py
index 60631f7a4..a4cefbc67 100644
--- a/tests/test_search.py
+++ b/tests/test_search.py
@@ -116,7 +116,7 @@ def test_term_in_heading_and_section(app, status, warning):
# if search term is in the title of one doc and in the text of another
# both documents should be a hit in the search index as a title,
# respectively text hit
- assert 'textinhead:1' in searchindex
+ assert 'textinhead:2' in searchindex
assert 'textinhead:0' in searchindex
@@ -252,3 +252,13 @@ def test_search_index_gen_zh(app, status, warning):
assert 'chinesetest' in searchindex
assert 'chinesetesttwo' in searchindex
assert 'cas' in searchindex
+
+
+@pytest.mark.sphinx(testroot='search')
+def test_nosearch(app):
+ app.build()
+ index = jsload(app.outdir / 'searchindex.js')
+ assert index['docnames'] == ['index', 'nosearch', 'tocitem']
+ assert 'latex' not in index['terms']
+ assert 'zfs' in index['terms']
+ assert index['terms']['zfs'] == 0 # zfs on nosearch.rst is not registered to index