-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add methods for Prefix Search settings requests
- Loading branch information
1 parent
4bc697d
commit cdbbdc1
Showing
6 changed files
with
113 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from meilisearch.models.index import PrefixSearch | ||
|
||
|
||
DEFAULT_PREFIX_SEARCH_SETTINGS = PrefixSearch.INDEXING_TIME | ||
|
||
|
||
def test_get_prefix_search(empty_index): | ||
response = empty_index().get_prefix_search() | ||
|
||
assert DEFAULT_PREFIX_SEARCH_SETTINGS == response | ||
|
||
|
||
def test_update_prefix_search(empty_index): | ||
index = empty_index() | ||
|
||
response = index.update_prefix_search(PrefixSearch.DISABLED) | ||
index.wait_for_task(response.task_uid) | ||
response = index.get_prefix_search() | ||
assert PrefixSearch.DISABLED == response | ||
|
||
response = index.update_prefix_search(PrefixSearch.INDEXING_TIME) | ||
index.wait_for_task(response.task_uid) | ||
response = index.get_prefix_search() | ||
assert PrefixSearch.INDEXING_TIME == response | ||
|
||
|
||
def test_reset_prefix_search(empty_index): | ||
index = empty_index() | ||
|
||
response = index.update_prefix_search(PrefixSearch.DISABLED) | ||
index.wait_for_task(response.task_uid) | ||
response = index.get_prefix_search() | ||
assert PrefixSearch.DISABLED == response | ||
assert DEFAULT_PREFIX_SEARCH_SETTINGS != response | ||
|
||
response = index.reset_prefix_search() | ||
index.wait_for_task(response.task_uid) | ||
response = index.get_prefix_search() | ||
assert DEFAULT_PREFIX_SEARCH_SETTINGS == response |