shahar1 commented on code in PR #76268:
URL: https://github.com/apache/airflow/pull/76268#discussion_r4458418168


##########
airflow-ctl/tests/airflow_ctl/api/test_operations.py:
##########
@@ -305,6 +305,48 @@ def 
test_execute_list_sends_limit_on_subsequent_pages(self):
         for call in mock_client.get.call_args_list:
             assert call.kwargs["params"]["limit"] == 2
 
+    def 
test_execute_list_advances_by_entries_received_when_server_caps_limit(self):
+        """A server with a lower ``api.maximum_page_limit`` returns fewer 
entries than requested;
+        paging must continue from what was received or the entries in between 
are skipped."""
+        mock_client = Mock()

Review Comment:
   nit — Testing: "Flag any `mock.Mock()` or `mock.MagicMock()` without `spec` 
or `autospec`."
   
   > **Flag any `mock.Mock()` or `mock.MagicMock()` without `spec` or 
`autospec`.** Unspec'd mocks silently accept any attribute access, hiding real 
bugs.
   
   The three new tests copy the bare `Mock()` of the older tests above them, 
but the newer tests at the bottom of this file already use `Mock(spec=Client)` 
for the client and `Mock(spec=httpx.Response, content=...)` for each page. 
Worth matching that here; the older tests can stay as they are.
   
   ```suggestion
           mock_client = Mock(spec=Client)
   ```



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