mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-15 15:34:07 +00:00
bdd: recreate functions on template DB
Avoids calling function refresh on every scenario. The content won't change between runs.
This commit is contained in:
@@ -172,11 +172,9 @@ class NominatimEnvironment:
|
||||
|
||||
self.template_db_done = True
|
||||
|
||||
if self._reuse_or_drop_db(self.template_db):
|
||||
return
|
||||
|
||||
self.write_nominatim_config(self.template_db)
|
||||
|
||||
if not self._reuse_or_drop_db(self.template_db):
|
||||
try:
|
||||
# execute nominatim import on an empty file to get the right tables
|
||||
with tempfile.NamedTemporaryFile(dir='/tmp', suffix='.xml') as fd:
|
||||
@@ -190,6 +188,8 @@ class NominatimEnvironment:
|
||||
self.db_drop_database(self.template_db)
|
||||
raise
|
||||
|
||||
self.run_nominatim('refresh', '--functions')
|
||||
|
||||
|
||||
def setup_api_db(self):
|
||||
""" Setup a test against the API test database.
|
||||
|
||||
@@ -93,7 +93,6 @@ def add_data_to_planet_ways(context):
|
||||
def import_and_index_data_from_place_table(context):
|
||||
""" Import data previously set up in the place table.
|
||||
"""
|
||||
context.nominatim.run_nominatim('refresh', '--functions')
|
||||
context.nominatim.run_nominatim('import', '--continue', 'load-data',
|
||||
'--index-noanalyse', '-q',
|
||||
'--offline')
|
||||
|
||||
Reference in New Issue
Block a user