import nominatim.tools.replication
import nominatim.db.status as status
+from nominatim.errors import UsageError
OSM_NODE_DATA = """\
<osm version="0.6" generator="OpenStreetMap server" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">
monkeypatch.setattr(nominatim.db.status, "get_url", lambda u : OSM_NODE_DATA)
- with pytest.raises(RuntimeError, match="Failed to reach replication service"):
+ with pytest.raises(UsageError, match="Failed to reach replication service"):
nominatim.tools.replication.init_replication(temp_db_conn, 'https://test.io')
max_diff_size=1)
def test_update_empty_status_table(status_table, temp_db_conn):
- with pytest.raises(RuntimeError):
+ with pytest.raises(UsageError):
nominatim.tools.replication.update(temp_db_conn, {})