mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 18:37:58 +00:00
reorganise fixtures for placex table
Now follows the same pattern as fixtures for other tables and uses the production SQL for table creation.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This file is part of Nominatim. (https://nominatim.org)
|
||||
#
|
||||
# Copyright (C) 2025 by the Nominatim developer community.
|
||||
# Copyright (C) 2026 by the Nominatim developer community.
|
||||
# For a full list of authors see the git log.
|
||||
"""
|
||||
Tests for correctly assigning wikipedia pages to places.
|
||||
@@ -38,7 +38,7 @@ def wiki_csv(tmp_path, sql_preprocessor):
|
||||
{'wikipedia': 'en:Test'},
|
||||
{'wikidata': 'Q123'}])
|
||||
def test_wikipedia(dsn, temp_db_conn, temp_db_cursor, table_factory,
|
||||
def_config, wiki_csv, placex_table, extra):
|
||||
def_config, wiki_csv, placex_row, extra):
|
||||
import_wikipedia_articles(dsn, wiki_csv([('en', 'Test', 0.3, 'Q123')]))
|
||||
create_functions(temp_db_conn, def_config)
|
||||
|
||||
@@ -46,7 +46,7 @@ def test_wikipedia(dsn, temp_db_conn, temp_db_cursor, table_factory,
|
||||
'SELECT language, title, importance, wikidata FROM wikimedia_importance')
|
||||
assert content == set([('en', 'Test', 0.3, 'Q123')])
|
||||
|
||||
place_id = placex_table.add(osm_id=12, extratags=extra)
|
||||
place_id = placex_row(osm_id=12, extratags=extra)
|
||||
table_factory('search_name',
|
||||
'place_id BIGINT, importance FLOAT',
|
||||
[(place_id, 0.2)])
|
||||
@@ -61,11 +61,11 @@ def test_wikipedia(dsn, temp_db_conn, temp_db_cursor, table_factory,
|
||||
|
||||
|
||||
def test_wikipedia_no_match(dsn, temp_db_conn, temp_db_cursor, def_config, wiki_csv,
|
||||
placex_table, table_factory):
|
||||
placex_row, table_factory):
|
||||
import_wikipedia_articles(dsn, wiki_csv([('de', 'Test', 0.3, 'Q123')]))
|
||||
create_functions(temp_db_conn, def_config)
|
||||
|
||||
place_id = placex_table.add(osm_id=12, extratags={'wikipedia': 'en:Test'}, rank_search=10)
|
||||
place_id = placex_row(osm_id=12, extratags={'wikipedia': 'en:Test'}, rank_search=10)
|
||||
table_factory('search_name',
|
||||
'place_id BIGINT, importance FLOAT',
|
||||
[(place_id, 0.2)])
|
||||
|
||||
Reference in New Issue
Block a user