21
21
def test_get_typo_tolerance_default (empty_index ):
22
22
"""Tests getting default typo_tolerance."""
23
23
response = empty_index ().get_typo_tolerance ()
24
+
24
25
assert isinstance (response , dict )
25
26
assert response == DEFAULT_TYPO_TOLERANCE
26
27
27
28
def test_update_typo_tolerance (empty_index ):
28
29
"""Tests updating typo_tolerance."""
29
30
index = empty_index ()
31
+
30
32
response = index .update_typo_tolerance (NEW_TYPO_TOLERANCE )
33
+
31
34
assert isinstance (response , dict )
32
35
assert 'uid' in response
36
+
33
37
update = index .wait_for_task (response ['uid' ])
38
+
34
39
assert update ['status' ] == 'succeeded'
40
+
35
41
response = index .get_typo_tolerance ()
42
+
36
43
assert isinstance (response , dict )
37
44
for typo_tolerance in NEW_TYPO_TOLERANCE :
38
45
assert typo_tolerance in response
@@ -41,21 +48,31 @@ def test_update_typo_tolerance(empty_index):
41
48
def test_reset_typo_tolerance (empty_index ):
42
49
"""Tests resetting the typo_tolerance setting to its default value."""
43
50
index = empty_index ()
51
+
44
52
# Update the settings first
45
53
response = index .update_typo_tolerance (NEW_TYPO_TOLERANCE )
46
54
update = index .wait_for_task (response ['uid' ])
55
+
47
56
assert update ['status' ] == 'succeeded'
57
+
48
58
# Check the settings have been correctly updated
49
59
response = index .get_typo_tolerance ()
60
+
50
61
assert isinstance (response , dict )
51
62
for typo_tolerance in NEW_TYPO_TOLERANCE :
52
63
assert typo_tolerance in response
53
64
assert NEW_TYPO_TOLERANCE [typo_tolerance ] == response [typo_tolerance ]
65
+
54
66
# Check the reset of the settings
55
67
response = index .reset_typo_tolerance ()
68
+
56
69
assert isinstance (response , dict )
57
70
assert 'uid' in response
71
+
58
72
update = index .wait_for_task (response ['uid' ])
73
+
59
74
assert update ['status' ] == 'succeeded'
75
+
60
76
response = index .get_typo_tolerance ()
77
+
61
78
assert response == DEFAULT_TYPO_TOLERANCE
0 commit comments