From de9f1155ea57c812171abd5517ab39f4fe135cb3 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Fri, 17 Dec 2021 10:07:15 +0100 Subject: apply first round of feedback on matching --- tests/test_matching.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests/test_matching.py') diff --git a/tests/test_matching.py b/tests/test_matching.py index eb54751..a8f8f5b 100644 --- a/tests/test_matching.py +++ b/tests/test_matching.py @@ -29,8 +29,7 @@ logger.setLevel(logging.DEBUG) FATCAT_SEARCH_URL = settings.get("FATCAT_SEARCH_URL", "https://search.fatcat.wiki:443") -def yaml_to_cases(klass, - files="tests/files/fuzzy_release_match_release_exact_title_exact_contrib/*.yaml"): +def yaml_to_cases(klass, files="tests/files/fuzzy_release_matcher/*.yaml"): """ Turn yaml files into a collection of named tuple test cases. The glob is relative to the project root (i.e. where you usually run `pytest` from). @@ -54,10 +53,12 @@ def test_simple_fuzzy_release_matcher(es_client, caplog): the result to be sensible, but should also document broken examples here. """ matcher = FuzzyReleaseMatcher(es=es_client) - Case = collections.namedtuple("Case", "about input release_year_padding expected") + Case = collections.namedtuple( + "Case", ["about", "input", "skip_id_matching", "release_year_padding", "expected"]) cases = yaml_to_cases(Case, "tests/files/fuzzy_release_matcher/*.yaml") for i, c in enumerate(cases): matcher.release_year_padding = c.release_year_padding + matcher.skip_id_matching = c.skip_id_matching entity = entity_from_json(c.input, ReleaseEntity) result = matcher.match(entity) assert set([r.ident for r in result]) == set(c.expected), "[{}] {}".format(c.about, c.input) -- cgit v1.2.3