Integrated OSM views into importance computation

This commit is contained in:
Tareq Al-Ahdal
2022-08-25 09:45:18 +02:00
committed by Sarah Hoffmann
parent ac467c7a2d
commit 0ab0f0ea44
8 changed files with 113 additions and 37 deletions

View File

@@ -69,7 +69,7 @@ class TestCliImportWithDb:
assert cf_mock.called > 1
for mock in mocks:
assert mock.called > 0, "Mock '{}' not called".format(mock.func_name)
assert mock.called == 1, "Mock '{}' not called".format(mock.func_name)
def test_import_continue_load_data(self, mock_func_factory):

View File

@@ -32,7 +32,7 @@ class TestRefresh:
func_mock = mock_func_factory(nominatim.tools.refresh, func)
assert self.call_nominatim('refresh', '--' + command) == 0
assert func_mock.called > 0
assert func_mock.called == 1
def test_refresh_word_count(self):

View File

@@ -38,6 +38,7 @@ def test_recompute_importance(placex_table, table_factory, temp_db_conn, temp_db
temp_db_cursor.execute("""CREATE OR REPLACE FUNCTION compute_importance(extratags HSTORE,
country_code varchar(2),
osm_type varchar(1), osm_id BIGINT,
centroid GEOMETRY,
OUT importance FLOAT,
OUT wikipedia TEXT)
AS $$ SELECT 0.1::float, 'foo'::text $$ LANGUAGE SQL""")