aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_matching.py
blob: 927b383e2c3c3d3c4a460773c523523e8e102a87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from fuzzycat.matching import anything_to_entity, match_release_fuzzy
from fatcat_openapi_client import ReleaseEntity
import pytest
import elasticsearch

@pytest.fixture
def es_client():
    return elasticsearch.Elasticsearch(["https://search.fatcat.wiki:80"])

@pytest.mark.skip
def test_match_release_fuzzy(es_client):
    cases = (
        ("wtv64ahbdzgwnan7rllwr3nurm", 2),
    )
    for case, count in cases:
        entity = anything_to_entity(case, ReleaseEntity)

        result = match_release_fuzzy(entity, es=es_client)
        assert len(result) == count