aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-11-25 01:29:38 +0100
committerMartin Czygan <martin.czygan@gmail.com>2020-11-25 01:29:38 +0100
commit16c0bbd6339aadad8b994867ba05a44a0b326a25 (patch)
tree2a1d65ea8f293eb8f95e293ca5304aa4aadbf7bd /tests
parent6bf0cb8a908122eed9cccd7f9fae35377a692c1d (diff)
downloadfuzzycat-16c0bbd6339aadad8b994867ba05a44a0b326a25.tar.gz
fuzzycat-16c0bbd6339aadad8b994867ba05a44a0b326a25.zip
extend tests
Diffstat (limited to 'tests')
-rw-r--r--tests/test_utils.py7
1 files changed, 6 insertions, 1 deletions
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