mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
enable flake for Python tests
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This file is part of Nominatim. (https://nominatim.org)
|
||||
#
|
||||
# Copyright (C) 2024 by the Nominatim developer community.
|
||||
# Copyright (C) 2025 by the Nominatim developer community.
|
||||
# For a full list of authors see the git log.
|
||||
"""
|
||||
Tests for the sanitizer that handles braced suffixes.
|
||||
@@ -12,6 +12,7 @@ import pytest
|
||||
from nominatim_db.tokenizer.place_sanitizer import PlaceSanitizer
|
||||
from nominatim_db.data.place_info import PlaceInfo
|
||||
|
||||
|
||||
class TestStripBrace:
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
@@ -24,23 +25,19 @@ class TestStripBrace:
|
||||
|
||||
return sorted([(p.name, p.kind, p.suffix) for p in name])
|
||||
|
||||
|
||||
def test_no_braces(self):
|
||||
assert self.run_sanitizer_on(name='foo', ref='23') == [('23', 'ref', None),
|
||||
('foo', 'name', None)]
|
||||
|
||||
|
||||
def test_simple_braces(self):
|
||||
assert self.run_sanitizer_on(name='Halle (Saale)', ref='3')\
|
||||
== [('3', 'ref', None), ('Halle', 'name', None), ('Halle (Saale)', 'name', None)]
|
||||
assert self.run_sanitizer_on(name='ack ( bar')\
|
||||
== [('ack', 'name', None), ('ack ( bar', 'name', None)]
|
||||
|
||||
assert self.run_sanitizer_on(name='Halle (Saale)', ref='3') \
|
||||
== [('3', 'ref', None), ('Halle', 'name', None), ('Halle (Saale)', 'name', None)]
|
||||
assert self.run_sanitizer_on(name='ack ( bar') \
|
||||
== [('ack', 'name', None), ('ack ( bar', 'name', None)]
|
||||
|
||||
def test_only_braces(self):
|
||||
assert self.run_sanitizer_on(name='(maybe)') == [('(maybe)', 'name', None)]
|
||||
|
||||
|
||||
def test_double_braces(self):
|
||||
assert self.run_sanitizer_on(name='a((b))') == [('a', 'name', None),
|
||||
('a((b))', 'name', None)]
|
||||
|
||||
Reference in New Issue
Block a user