From 16c0bbd6339aadad8b994867ba05a44a0b326a25 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Wed, 25 Nov 2020 01:29:38 +0100 Subject: extend tests --- tests/test_utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test_utils.py b/tests/test_utils.py index d0e5d48..1d27e96 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,5 +1,5 @@ import pytest -from fuzzycat.utils import slugify_string, cut +from fuzzycat.utils import slugify_string, cut, author_similarity_score def test_slugify_string(): @@ -21,3 +21,8 @@ def test_cut(): assert cut(3, sep=',')("a,b,c") == "" with pytest.raises(ValueError): cut(3, sep=',', ignore_missing_column=False)("a,b,c") == "" + +def test_author_similarity_score(): + assert author_similarity_score("", "") == 0.0 + assert author_similarity_score("Gregor Samsa", "G. Samsa") == 0.42857142857142855 + assert author_similarity_score("Geronimo Samsa", "G. Samsa") == 0.375 -- cgit v1.2.3