+def test_get_libpq_dsn_convert_default():
+ config = Configuration(None, DEFCFG_DIR)
+
+ assert config.get_libpq_dsn() == 'dbname=nominatim'
+
+def test_get_libpq_dsn_convert_php(monkeypatch):
+ config = Configuration(None, DEFCFG_DIR)
+
+ monkeypatch.setenv('NOMINATIM_DATABASE_DSN',
+ 'pgsql:dbname=gis;password=foo;host=localhost')
+
+ assert config.get_libpq_dsn() == 'dbname=gis password=foo host=localhost'
+
+def test_get_libpq_dsn_convert_libpq(monkeypatch):
+ config = Configuration(None, DEFCFG_DIR)
+
+ monkeypatch.setenv('NOMINATIM_DATABASE_DSN',
+ 'host=localhost dbname=gis password=foo')
+
+ assert config.get_libpq_dsn() == 'host=localhost dbname=gis password=foo'