Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

Commit 2fca5c7

Browse files
tests: add limit check assertion in pagination test
1 parent 8886988 commit 2fca5c7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test_order.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,9 @@ def setup_pagination(stapi_client: TestClient, create_order_payloads) -> None:
161161
assert res.headers["Content-Type"] == "application/geo+json"
162162

163163

164-
def test_order_pagination(stapi_client: TestClient, setup_pagination) -> None:
165-
res = stapi_client.get("/orders", params={"next": None, "limit": 1})
164+
@pytest.mark.parametrize("limit", [2])
165+
def test_order_pagination(stapi_client: TestClient, setup_pagination, limit) -> None:
166+
res = stapi_client.get("/orders", params={"next": None, "limit": limit})
166167
assert res.status_code == status.HTTP_200_OK
167168
body = res.json()
168169
next = body["links"][0]["href"]
@@ -172,6 +173,7 @@ def test_order_pagination(stapi_client: TestClient, setup_pagination) -> None:
172173
assert res.status_code == status.HTTP_200_OK
173174
body = res.json()
174175
if body["links"]:
176+
assert len(body["features"]) == limit
175177
next = body["links"][0]["href"]
176178
else:
177179
break

0 commit comments

Comments
 (0)