yummyPancake2607 commented on code in PR #4065:
URL: https://github.com/apache/iggy/pull/4065#discussion_r3940341865


##########
foreign/python/tests/test_client_info.py:
##########
@@ -0,0 +1,212 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Tests for connection introspection via get_me, get_client and 
get_clients."""
+
+import pytest
+
+from apache_iggy import (
+    ClientInfo,
+    ClientInfoDetails,
+    GlobalPermissions,
+    IggyClient,
+    Permissions,
+)
+
+from .utils import login_fresh_client, unique_credentials
+
+
+def unused_client_id(clients: list[ClientInfo]) -> int:
+    """Return a client id that no currently connected client holds."""
+    return max((client.client_id for client in clients), default=0) + 1_000_000
+
+
+async def group_with_distinct_ids(client: IggyClient, unique_name):
+    """Create a stream, topic and consumer group with pairwise distinct ids.

Review Comment:
   both were only called from one place each.
   
   - `unused_client_id(clients)` is now inlined directly into
     `test_get_client_unknown_id_returns_none` as a local
     `unused_id = max((c.client_id for c in clients), default=0) + 1_000_000`.
   - `group_with_distinct_ids(client, unique_name)` is now inlined into
     `test_get_me_reports_joined_consumer_group`, using `iggy_client` directly
     instead of a generic `client` param; its docstring became a comment above
     the stream/topic/group setup explaining why three candidates are created
     to force distinct ids.



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