X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/d8240f9ee475daef1412f0e2cdf36efeba6666f3..81eed0680cd2a8b5c53217ab2996a43ab17f5056:/test/python/api/search/test_legacy_query_analyzer.py?ds=sidebyside diff --git a/test/python/api/search/test_legacy_query_analyzer.py b/test/python/api/search/test_legacy_query_analyzer.py index c2115853..507afaec 100644 --- a/test/python/api/search/test_legacy_query_analyzer.py +++ b/test/python/api/search/test_legacy_query_analyzer.py @@ -195,11 +195,10 @@ async def test_penalty_postcodes_and_housenumbers(conn, term, order): assert query.num_token_slots() == 1 - torder = [(tl.tokens[0].penalty, tl.ttype) for tl in query.nodes[0].starting] - print(query.nodes[0].starting) + torder = [(tl.tokens[0].penalty, tl.ttype.name) for tl in query.nodes[0].starting] torder.sort() - assert [t[1] for t in torder] == [TokenType[o] for o in order] + assert [t[1] for t in torder] == order @pytest.mark.asyncio @@ -213,7 +212,7 @@ async def test_category_words_only_at_beginning(conn): assert query.num_token_slots() == 3 assert len(query.nodes[0].starting) == 1 - assert query.nodes[0].starting[0].ttype == TokenType.CATEGORY + assert query.nodes[0].starting[0].ttype == TokenType.NEAR_ITEM assert not query.nodes[2].starting @@ -227,9 +226,9 @@ async def test_qualifier_words(conn): query = await ana.analyze_query(make_phrase('foo BAR foo BAR foo')) assert query.num_token_slots() == 5 - assert set(t.ttype for t in query.nodes[0].starting) == {TokenType.CATEGORY, TokenType.QUALIFIER} + assert set(t.ttype for t in query.nodes[0].starting) == {TokenType.NEAR_ITEM, TokenType.QUALIFIER} assert set(t.ttype for t in query.nodes[2].starting) == {TokenType.QUALIFIER} - assert set(t.ttype for t in query.nodes[4].starting) == {TokenType.CATEGORY, TokenType.QUALIFIER} + assert set(t.ttype for t in query.nodes[4].starting) == {TokenType.NEAR_ITEM, TokenType.QUALIFIER} @pytest.mark.asyncio