@@ -889,20 +889,18 @@ def test_similarity_without_good_canididates():
889
889
890
890
891
891
def test_similarity_overwrite_function ():
892
- suggested_command = cu .suggest_similar ("test" , ["history" , "test" ])
892
+ options = ["history" , "test" ]
893
+ suggested_command = cu .suggest_similar ("test" , options )
893
894
assert suggested_command == 'test'
894
895
895
896
def custom_similarity_function (s1 , s2 ):
896
897
return 1.0 if 'history' in (s1 , s2 ) else 0.0
897
898
898
- suggested_command = cu .suggest_similar ("test" , ["history" , "test" ],
899
- similarity_function_to_use = custom_similarity_function )
899
+ suggested_command = cu .suggest_similar ("test" , options , similarity_function_to_use = custom_similarity_function )
900
900
assert suggested_command == 'history'
901
901
902
- suggested_command = cu .suggest_similar ("history" , ["history" , "test" ],
903
- similarity_function_to_use = custom_similarity_function )
902
+ suggested_command = cu .suggest_similar ("history" , options , similarity_function_to_use = custom_similarity_function )
904
903
assert suggested_command == 'history'
905
904
906
- suggested_command = cu .suggest_similar ("test" , ["test" ],
907
- similarity_function_to_use = custom_similarity_function )
905
+ suggested_command = cu .suggest_similar ("test" , ["test" ], similarity_function_to_use = custom_similarity_function )
908
906
assert suggested_command is None
0 commit comments