aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-09-21 15:55:52 +0200
committerMartin Czygan <martin.czygan@gmail.com>2021-09-21 15:55:52 +0200
commitdccbaa5c1b0ba556449de6024540ba05d67ef6a0 (patch)
tree60876376084fbeb1ec541079bc458d9f7858370d /tests
parent6a224c316869ba2651094ad47e1d92e102524f85 (diff)
downloadfuzzycat-dccbaa5c1b0ba556449de6024540ba05d67ef6a0.tar.gz
fuzzycat-dccbaa5c1b0ba556449de6024540ba05d67ef6a0.zip
matching: run an additional es query for fuzzy matching
Diffstat (limited to 'tests')
-rw-r--r--tests/test_matching.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/tests/test_matching.py b/tests/test_matching.py
index 2122144..c2e26f3 100644
--- a/tests/test_matching.py
+++ b/tests/test_matching.py
@@ -72,6 +72,24 @@ def test_match_release_fuzzy(es_client, caplog):
"ext_ids": {}
}, 5),
({
+ "title": "unlikelytitle",
+ "ext_ids": {}
+ }, 0),
+ ({
+ "title": "Imminent dystopia",
+ "ext_ids": {}
+ }, 2),
+ ({
+ "title": "",
+ "contribs": [{"raw_name": "Aristoteles"}],
+ "ext_ids": {}
+ }, 5),
+ ({
+ "title": "Letter",
+ "contribs": [{"raw_name": "Claudel"}],
+ "ext_ids": {}
+ }, 1),
+ ({
"title": "The Future of Digital Scholarship",
"contribs": [{
"raw_name": "Costantino Thanos"
@@ -83,6 +101,6 @@ def test_match_release_fuzzy(es_client, caplog):
entity = entity_from_dict(doc, ReleaseEntity)
result = match_release_fuzzy(entity, es=es_client)
with caplog.at_level(logging.INFO):
- logging.info("[{}] given {}, found {}, {}".format(i, entity.title, len(result),
+ logging.info("[{}] given title '{}', found {}, {}".format(i, entity.title, len(result),
[v.title for v in result]))
- assert len(result) == count
+ assert len(result) == count, doc