X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/c1fa70639ba2f861cd6a7718e5b02f0ade763abc..345637290b85dc24f5023f07d919ff5d8dc486e9:/test/python/test_cli_replication.py diff --git a/test/python/test_cli_replication.py b/test/python/test_cli_replication.py index 2dd35c0e..8e47e96e 100644 --- a/test/python/test_cli_replication.py +++ b/test/python/test_cli_replication.py @@ -106,6 +106,16 @@ class TestCliReplication: assert str(update_mock.last_args[1]['osm2pgsql']) == '/secret/osm2pgsql' + @pytest.mark.parametrize("update_interval", [60, 3600]) + def test_replication_catchup(self, monkeypatch, index_mock, update_interval, placex_table): + monkeypatch.setenv('NOMINATIM_REPLICATION_UPDATE_INTERVAL', str(update_interval)) + states = [nominatim.tools.replication.UpdateState.NO_CHANGES] + monkeypatch.setattr(nominatim.tools.replication, 'update', + lambda *args, **kwargs: states.pop()) + + assert self.call_nominatim('--catch-up') == 0 + + def test_replication_update_custom_threads(self, update_mock): assert self.call_nominatim('--once', '--no-index', '--threads', '4') == 0