bbovenzi commented on code in PR #76932:
URL: https://github.com/apache/airflow/pull/76932#discussion_r4619787479
##########
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_event_logs.py:
##########
@@ -829,3 +829,76 @@ def test_non_dag_rows_are_gated_on_audit_logs_all(
mock_is_authorized_view.assert_called_once_with(
access_view=AccessView.AUDIT_LOGS_ALL, user=mock.ANY,
team_name=None
)
+
+ @pytest.mark.parametrize("order_by", ["-when", "event", "owner",
"-event_log_id"])
+ def test_cursor_pagination_forward_then_previous_page(self, test_client,
order_by):
+ """Every row is reached once going forward, and previous_cursor
retraces the same pages."""
+ forward_pages = []
+ cursor = ""
+ while cursor is not None:
+ response = test_client.get(
+ "/eventLogs", params={"limit": 3, "order_by": order_by,
"cursor": cursor}
+ )
+ assert response.status_code == 200, response.json()
+ body = response.json()
+ forward_pages.append(body)
+ cursor = body["next_cursor"]
+
+ forward_ids = [log["event_log_id"] for page in forward_pages for log
in page["event_logs"]]
+ assert len(forward_pages) == 2
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]