Skip to content

Commit 23664ba

Browse files
committed
Update test to reflect new pagination constraints
1 parent 536d319 commit 23664ba

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/routers/openml/migration/tasks_migration_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
nested_remove_single_element_list,
1212
nested_remove_values,
1313
)
14+
from routers.dependencies import LIMIT_MAX
1415

1516

1617
@pytest.mark.parametrize(
@@ -141,8 +142,7 @@ async def test_list_tasks_equal(
141142
- PHP error status is 412 PRECONDITION_FAILED; Python uses 404 NOT_FOUND.
142143
"""
143144
php_path = _build_php_task_list_path(php_params)
144-
# Use a very large limit on Python side to match PHP's unbounded default result count
145-
py_body = {**py_extra, "pagination": {"limit": 1_000_000, "offset": 0}}
145+
py_body = {**py_extra, "pagination": {"limit": LIMIT_MAX, "offset": 0}}
146146
py_response, php_response = await asyncio.gather(
147147
py_api.post("/tasks/list", json=py_body),
148148
php_api.get(php_path),
@@ -163,6 +163,7 @@ async def test_list_tasks_equal(
163163
php_tasks: list[dict[str, Any]] = (
164164
php_tasks_raw if isinstance(php_tasks_raw, list) else [php_tasks_raw]
165165
)
166+
php_tasks = php_tasks[:LIMIT_MAX]
166167
py_tasks: list[dict[str, Any]] = [_normalize_py_task(t) for t in py_response.json()]
167168

168169
php_ids = {int(t["task_id"]) for t in php_tasks}

0 commit comments

Comments
 (0)