X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/aa0ae610c6075fdaf9f1790a4ad8ec090a74ebd9..e74e5770294692b4a5bd4a730c974744d5ccfd81:/test/bdd/steps/nominatim_environment.py
diff --git a/test/bdd/steps/nominatim_environment.py b/test/bdd/steps/nominatim_environment.py
index 9bf182bc..c1a7dc26 100644
--- a/test/bdd/steps/nominatim_environment.py
+++ b/test/bdd/steps/nominatim_environment.py
@@ -172,23 +172,23 @@ class NominatimEnvironment:
self.template_db_done = True
- if self._reuse_or_drop_db(self.template_db):
- return
-
self.write_nominatim_config(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:
- fd.write(b'')
- fd.flush()
- self.run_nominatim('import', '--osm-file', fd.name,
- '--osm2pgsql-cache', '1',
- '--ignore-errors',
- '--offline', '--index-noanalyse')
- except:
- self.db_drop_database(self.template_db)
- raise
+ 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:
+ fd.write(b'')
+ fd.flush()
+ self.run_nominatim('import', '--osm-file', fd.name,
+ '--osm2pgsql-cache', '1',
+ '--ignore-errors',
+ '--offline', '--index-noanalyse')
+ except:
+ self.db_drop_database(self.template_db)
+ raise
+
+ self.run_nominatim('refresh', '--functions')
def setup_api_db(self):