Fix regional flood area pagination
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-16 01:34:12 +02:00
parent c018ed6dbb
commit ae82edf612
2 changed files with 24 additions and 8 deletions
@@ -42,9 +42,11 @@ class FakeSession:
def __init__(self, module):
self.module = module
self.posts: list[tuple[str, dict[str, Any]]] = []
self.gets: list[tuple[str, dict[str, Any]]] = []
self.headers: dict[str, str] = {}
def get(self, url: str, **_kwargs):
def get(self, url: str, **kwargs):
self.gets.append((url, kwargs.get("params") or {}))
if url.endswith("/api/v1/projects"):
return FakeResponse({"data": {"items": [{"id": "project-1", "name": "Kempen Regional Workbench"}]}})
if url.endswith("/areas"):
@@ -67,7 +69,10 @@ class FakeSession:
},
}
]
}
},
"total": 1,
"limit": kwargs.get("params", {}).get("limit", 50),
"offset": kwargs.get("params", {}).get("offset", 0),
}
)
if url.endswith("/datasets/flood-hazard/products"):
@@ -137,6 +142,7 @@ def test_regional_flood_operator_dry_run_uses_canonical_registry(monkeypatch, ca
assert '"status": "dry_run"' in output
assert '"planned_acquisitions": 1' in output
assert fake_session.posts == []
assert any(params.get("limit") == 200 for url, params in fake_session.gets if url.endswith("/areas"))
def test_regional_flood_operator_calls_acquisition_and_selection(monkeypatch, capsys) -> None: