ColtenOuO commented on code in PR #72388:
URL: https://github.com/apache/airflow/pull/72388#discussion_r3908306677


##########
providers/http/tests/unit/http/operators/test_http.py:
##########
@@ -443,15 +442,81 @@ def pagination_function(response: Response) -> dict | 
None:
             deferrable=True,
         )
 
-        # Do two calls: On the first one, the pagination_function creates a new
-        # deferrable trigger. On the second one, the pagination_function 
returns
-        # None, which ends the execution of the Operator
-        with contextlib.suppress(TaskDeferred):
+        with pytest.raises(TaskDeferred) as exc_info:
             operator.execute_complete(**create_resume_response_parameters())
-            result = operator.execute_complete(
-                **create_resume_response_parameters(), 
paginated_responses=[make_response_object()]
+
+        paginated_responses = exc_info.value.kwargs["paginated_responses"]
+        assert [r.text for r in paginated_responses] == ['{"value": 5}']
+
+        result = operator.execute_complete(
+            **create_resume_response_parameters(), 
paginated_responses=paginated_responses
+        )
+        assert result == ['{"value": 5}', '{"value": 5}']

Review Comment:
   I think that is a great idea! Thanks for the review.



-- 
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]

Reply via email to