From dccbaa5c1b0ba556449de6024540ba05d67ef6a0 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Tue, 21 Sep 2021 15:55:52 +0200 Subject: matching: run an additional es query for fuzzy matching --- tests/test_matching.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'tests') 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 @@ -71,6 +71,24 @@ def test_match_release_fuzzy(es_client, caplog): "title": "digital libraries", "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": [{ @@ -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 -- cgit v1.2.3