mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
enable BDD tests for sqlite databases
The database must currently be created by hand and the name handed in via -DAPI_TEST_DB='sqlite:...'.
This commit is contained in:
@@ -86,7 +86,10 @@ class NominatimEnvironment:
|
||||
be picked up by dotenv and creates a project directory with the
|
||||
appropriate website scripts.
|
||||
"""
|
||||
dsn = 'pgsql:dbname={}'.format(dbname)
|
||||
if dbname.startswith('sqlite:'):
|
||||
dsn = 'sqlite:dbname={}'.format(dbname[7:])
|
||||
else:
|
||||
dsn = 'pgsql:dbname={}'.format(dbname)
|
||||
if self.db_host:
|
||||
dsn += ';host=' + self.db_host
|
||||
if self.db_port:
|
||||
@@ -197,6 +200,9 @@ class NominatimEnvironment:
|
||||
"""
|
||||
self.write_nominatim_config(self.api_test_db)
|
||||
|
||||
if self.api_test_db.startswith('sqlite:'):
|
||||
return
|
||||
|
||||
if not self.api_db_done:
|
||||
self.api_db_done = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user