mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-13 06:14: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
|
self.template_db_done = True
|
||||||
|
|
||||||
if self._reuse_or_drop_db(self.template_db):
|
|
||||||
return
|
|
||||||
|
|
||||||
self.write_nominatim_config(self.template_db)
|
self.write_nominatim_config(self.template_db)
|
||||||
|
|
||||||
|
if not self._reuse_or_drop_db(self.template_db):
|
||||||
try:
|
try:
|
||||||
# execute nominatim import on an empty file to get the right tables
|
# execute nominatim import on an empty file to get the right tables
|
||||||
with tempfile.NamedTemporaryFile(dir='/tmp', suffix='.xml') as fd:
|
with tempfile.NamedTemporaryFile(dir='/tmp', suffix='.xml') as fd:
|
||||||
@@ -190,6 +188,8 @@ class NominatimEnvironment:
|
|||||||
self.db_drop_database(self.template_db)
|
self.db_drop_database(self.template_db)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
self.run_nominatim('refresh', '--functions')
|
||||||
|
|
||||||
|
|
||||||
def setup_api_db(self):
|
def setup_api_db(self):
|
||||||
""" Setup a test against the API test database.
|
""" 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):
|
def import_and_index_data_from_place_table(context):
|
||||||
""" Import data previously set up in the place table.
|
""" Import data previously set up in the place table.
|
||||||
"""
|
"""
|
||||||
context.nominatim.run_nominatim('refresh', '--functions')
|
|
||||||
context.nominatim.run_nominatim('import', '--continue', 'load-data',
|
context.nominatim.run_nominatim('import', '--continue', 'load-data',
|
||||||
'--index-noanalyse', '-q',
|
'--index-noanalyse', '-q',
|
||||||
'--offline')
|
'--offline')
|
||||||
|
|||||||
Reference in New Issue
Block a user