X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/d81e152804b81f3d61ee743e436dd14fe924ee58..fbe7be760be870189a15cc7ea7d7fc89e02a56b6:/test/python/test_cli.py diff --git a/test/python/test_cli.py b/test/python/test_cli.py index f62bccf7..0c0a689e 100644 --- a/test/python/test_cli.py +++ b/test/python/test_cli.py @@ -23,9 +23,11 @@ from nominatim.db import status def call_nominatim(*args): return nominatim.cli.nominatim(module_dir='build/module', osm2pgsql_path='build/osm2pgsql/osm2pgsql', - phplib_dir='lib', + phplib_dir='lib-php', data_dir='.', phpcgi_path='/usr/bin/php-cgi', + sqllib_dir='lib-sql', + config_dir='settings', cli_args=args) class MockParamCapture: @@ -86,7 +88,7 @@ def test_admin_command_legacy(monkeypatch, params): assert mock_run_legacy.called == 1 @pytest.mark.parametrize("func, params", [('analyse_indexing', ('--analyse-indexing', ))]) -def test_admin_command_tool(monkeypatch, func, params): +def test_admin_command_tool(temp_db, monkeypatch, func, params): mock = MockParamCapture() monkeypatch.setattr(nominatim.tools.admin, func, mock) @@ -184,17 +186,15 @@ def test_replication_update_bad_interval_for_geofabrik(monkeypatch, temp_db): assert call_nominatim('replication') == 1 -@pytest.mark.parametrize("state, retval", [ - (nominatim.tools.replication.UpdateState.UP_TO_DATE, 0), - (nominatim.tools.replication.UpdateState.NO_CHANGES, 3) - ]) +@pytest.mark.parametrize("state", [nominatim.tools.replication.UpdateState.UP_TO_DATE, + nominatim.tools.replication.UpdateState.NO_CHANGES]) def test_replication_update_once_no_index(monkeypatch, temp_db, temp_db_conn, - status_table, state, retval): + status_table, state): status.set_status(temp_db_conn, date=dt.datetime.now(dt.timezone.utc), seq=1) func_mock = MockParamCapture(retval=state) monkeypatch.setattr(nominatim.tools.replication, 'update', func_mock) - assert retval == call_nominatim('replication', '--once', '--no-index') + assert 0 == call_nominatim('replication', '--once', '--no-index') def test_replication_update_continuous(monkeypatch, temp_db_conn, status_table):