예제 #1
0
def test_get_fuzzy_alg_raises_error_with_unknown_name(
        searcher: FuzzySearcher) -> None:
    """It raises a ValueError if fuzzy_func does not match a predefined key name."""
    with pytest.raises(ValueError):
        searcher.get_fuzzy_func("unkown")
예제 #2
0
def test_get_fuzzy_alg_returns_alg(searcher: FuzzySearcher) -> None:
    """It returns the expected fuzzy matching function."""
    func = searcher.get_fuzzy_func("simple")
    assert func == fuzz.ratio