Skip to content

Commit 21b221b

Browse files
committed
Add typo tolerance check in general settings tests
1 parent db06fc6 commit 21b221b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/settings/test_settings.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,24 @@
1313
'exactness'
1414
]
1515

16+
DEFAUT_TYPO_TOLERANCE = {
17+
'enabled': True,
18+
'minWordSizeForTypos': {
19+
'oneTypo': 5,
20+
'twoTypos': 9,
21+
},
22+
'disableOnWords': [],
23+
'disableOnAttributes': [],
24+
}
25+
1626
def test_get_settings_default(empty_index):
1727
"""Tests getting all settings by default."""
1828
response = empty_index().get_settings()
1929
assert isinstance(response, dict)
2030
for rule in DEFAULT_RANKING_RULES:
2131
assert rule in response['rankingRules']
32+
for typo in DEFAUT_TYPO_TOLERANCE:
33+
assert typo in response['typoTolerance']
2234
assert response['distinctAttribute'] is None
2335
assert response['searchableAttributes'] == ['*']
2436
assert response['displayedAttributes'] == ['*']
@@ -69,6 +81,8 @@ def test_reset_settings(empty_index):
6981
response = index.get_settings()
7082
for rule in DEFAULT_RANKING_RULES:
7183
assert rule in response['rankingRules']
84+
for typo in DEFAUT_TYPO_TOLERANCE:
85+
assert typo in response['typoTolerance']
7286
assert response['distinctAttribute'] is None
7387
assert response['displayedAttributes'] == ['*']
7488
assert response['searchableAttributes'] == ['*']

0 commit comments

Comments
 (0)