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


##########
foreign/python/tests/test_client_info.py:
##########
@@ -0,0 +1,111 @@
+# 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.
+
+import pytest
+
+from apache_iggy import ClientInfo, ClientInfoDetails, IggyClient
+
+
+class TestGetMe:
+    """Test get_me returns the currently connected client."""
+
+    @pytest.mark.asyncio
+    async def test_get_me_returns_client_info_details(self, iggy_client: 
IggyClient):
+        """get_me() should return a ClientInfoDetails with valid fields."""
+        me = await iggy_client.get_me()
+        assert isinstance(me, ClientInfoDetails)
+        assert isinstance(me.client_id, int)
+        assert me.client_id > 0
+        assert isinstance(me.address, str)
+        assert len(me.address) > 0
+        assert isinstance(me.transport, str)
+        assert isinstance(me.consumer_groups_count, int)
+        assert isinstance(me.consumer_groups, list)

Review Comment:
    I've updated the test fixture to join a consumer group first before 
asserting on `consumer_groups`. The test now creates a group, joins it, and 
asserts the IDs are populated correctly. This ensures `ConsumerGroupInfo` field 
mapping and `ClientGroupMember` are actually tested rather than always being 
empty.



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