File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 13
13
'exactness'
14
14
]
15
15
16
+ DEFAUT_TYPO_TOLERANCE = {
17
+ 'enabled' : True ,
18
+ 'minWordSizeForTypos' : {
19
+ 'oneTypo' : 5 ,
20
+ 'twoTypos' : 9 ,
21
+ },
22
+ 'disableOnWords' : [],
23
+ 'disableOnAttributes' : [],
24
+ }
25
+
16
26
def test_get_settings_default (empty_index ):
17
27
"""Tests getting all settings by default."""
18
28
response = empty_index ().get_settings ()
19
29
assert isinstance (response , dict )
20
30
for rule in DEFAULT_RANKING_RULES :
21
31
assert rule in response ['rankingRules' ]
32
+ for typo in DEFAUT_TYPO_TOLERANCE :
33
+ assert typo in response ['typoTolerance' ]
22
34
assert response ['distinctAttribute' ] is None
23
35
assert response ['searchableAttributes' ] == ['*' ]
24
36
assert response ['displayedAttributes' ] == ['*' ]
@@ -69,6 +81,8 @@ def test_reset_settings(empty_index):
69
81
response = index .get_settings ()
70
82
for rule in DEFAULT_RANKING_RULES :
71
83
assert rule in response ['rankingRules' ]
84
+ for typo in DEFAUT_TYPO_TOLERANCE :
85
+ assert typo in response ['typoTolerance' ]
72
86
assert response ['distinctAttribute' ] is None
73
87
assert response ['displayedAttributes' ] == ['*' ]
74
88
assert response ['searchableAttributes' ] == ['*' ]
You can’t perform that action at this time.
0 commit comments