add tests for cleaning housenumbers

This commit is contained in:
Sarah Hoffmann
2022-01-20 23:47:20 +01:00
parent 3ce123ab69
commit c170d323d9
7 changed files with 106 additions and 1 deletions

View File

@@ -30,6 +30,7 @@ class DummyTokenizer:
self.update_sql_functions_called = False
self.finalize_import_called = False
self.update_statistics_called = False
self.update_word_tokens_called = False
def update_sql_functions(self, *args):
self.update_sql_functions_called = True
@@ -40,6 +41,9 @@ class DummyTokenizer:
def update_statistics(self):
self.update_statistics_called = True
def update_word_tokens(self):
self.update_word_tokens_called = True
@pytest.fixture
def cli_call(src_dir):

View File

@@ -39,6 +39,11 @@ class TestRefresh:
assert self.tokenizer_mock.update_statistics_called
def test_refresh_word_tokens(self):
assert self.call_nominatim('refresh', '--word-tokens') == 0
assert self.tokenizer_mock.update_word_tokens_called
def test_refresh_postcodes(self, mock_func_factory, place_table):
func_mock = mock_func_factory(nominatim.tools.postcodes, 'update_postcodes')
idx_mock = mock_func_factory(nominatim.indexer.indexer.Indexer, 'index_postcodes')