Skip to content

Commit 96cbf24

Browse files
committed
Add test to check the value in typo tolerance setting
1 parent 1530d5e commit 96cbf24

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

tests/settings/test_settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def test_get_settings_default(empty_index):
3131
assert rule in response['rankingRules']
3232
for typo in DEFAULT_TYPO_TOLERANCE:
3333
assert typo in response['typoTolerance']
34+
assert DEFAULT_TYPO_TOLERANCE.get(typo) == response['typoTolerance'][typo]
3435
assert response['distinctAttribute'] is None
3536
assert response['searchableAttributes'] == ['*']
3637
assert response['displayedAttributes'] == ['*']
@@ -83,6 +84,7 @@ def test_reset_settings(empty_index):
8384
assert rule in response['rankingRules']
8485
for typo in DEFAULT_TYPO_TOLERANCE:
8586
assert typo in response['typoTolerance']
87+
assert DEFAULT_TYPO_TOLERANCE.get(typo) == response['typoTolerance'][typo]
8688
assert response['distinctAttribute'] is None
8789
assert response['displayedAttributes'] == ['*']
8890
assert response['searchableAttributes'] == ['*']

tests/settings/test_settings_typo_tolerance_meilisearch.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def test_update_typo_tolerance(empty_index):
3737
assert isinstance(response, dict)
3838
for typo_tolerance in NEW_TYPO_TOLERANCE:
3939
assert typo_tolerance in response
40+
assert NEW_TYPO_TOLERANCE.get(typo_tolerance) == response[typo_tolerance]
4041

4142
def test_reset_typo_tolerance(empty_index):
4243
"""Tests resetting the typo_tolerance setting to its default value."""
@@ -50,6 +51,7 @@ def test_reset_typo_tolerance(empty_index):
5051
assert isinstance(response, dict)
5152
for typo_tolerance in NEW_TYPO_TOLERANCE:
5253
assert typo_tolerance in response
54+
assert NEW_TYPO_TOLERANCE.get(typo_tolerance) == response[typo_tolerance]
5355
# Check the reset of the settings
5456
response = index.reset_typo_tolerance()
5557
assert isinstance(response, dict)

0 commit comments

Comments
 (0)