Skip to content

Commit 91b4265

Browse files
committed
Improve tests typo tolerance
1 parent 96cbf24 commit 91b4265

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

tests/settings/test_settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +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]
34+
assert DEFAULT_TYPO_TOLERANCE[typo] == response['typoTolerance'][typo]
3535
assert response['distinctAttribute'] is None
3636
assert response['searchableAttributes'] == ['*']
3737
assert response['displayedAttributes'] == ['*']
@@ -84,7 +84,7 @@ def test_reset_settings(empty_index):
8484
assert rule in response['rankingRules']
8585
for typo in DEFAULT_TYPO_TOLERANCE:
8686
assert typo in response['typoTolerance']
87-
assert DEFAULT_TYPO_TOLERANCE.get(typo) == response['typoTolerance'][typo]
87+
assert DEFAULT_TYPO_TOLERANCE[typo] == response['typoTolerance'][typo]
8888
assert response['distinctAttribute'] is None
8989
assert response['displayedAttributes'] == ['*']
9090
assert response['searchableAttributes'] == ['*']

tests/settings/test_settings_typo_tolerance_meilisearch.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ def test_get_typo_tolerance_default(empty_index):
2323
response = empty_index().get_typo_tolerance()
2424
assert isinstance(response, dict)
2525
assert response == DEFAULT_TYPO_TOLERANCE
26-
print(response)
2726

2827
def test_update_typo_tolerance(empty_index):
2928
"""Tests updating typo_tolerance."""
@@ -37,7 +36,7 @@ def test_update_typo_tolerance(empty_index):
3736
assert isinstance(response, dict)
3837
for typo_tolerance in NEW_TYPO_TOLERANCE:
3938
assert typo_tolerance in response
40-
assert NEW_TYPO_TOLERANCE.get(typo_tolerance) == response[typo_tolerance]
39+
assert NEW_TYPO_TOLERANCE[typo_tolerance] == response[typo_tolerance]
4140

4241
def test_reset_typo_tolerance(empty_index):
4342
"""Tests resetting the typo_tolerance setting to its default value."""
@@ -51,7 +50,7 @@ def test_reset_typo_tolerance(empty_index):
5150
assert isinstance(response, dict)
5251
for typo_tolerance in NEW_TYPO_TOLERANCE:
5352
assert typo_tolerance in response
54-
assert NEW_TYPO_TOLERANCE.get(typo_tolerance) == response[typo_tolerance]
53+
assert NEW_TYPO_TOLERANCE[typo_tolerance] == response[typo_tolerance]
5554
# Check the reset of the settings
5655
response = index.reset_typo_tolerance()
5756
assert isinstance(response, dict)

0 commit comments

Comments
 (0)