Mukezh commented on code in PR #4276:
URL: https://github.com/apache/iggy/pull/4276#discussion_r4174007052


##########
foreign/python/tests/test_user.py:
##########
@@ -208,6 +256,43 @@ async def test_create_user_accepts_multibyte_credentials(
         await iggy_client.delete_user(created.id)
 
 
+class TestLoginIdentity:
+    """Test login returns IdentityInfo with transport-specific access_token."""
+
+    @pytest.mark.asyncio
+    async def test_login_user_returns_identity_without_access_token(
+        self, iggy_client: IggyClient
+    ):
+        """Test TCP login returns user_id and no HTTP access token."""
+        root = await iggy_client.get_user("iggy")
+        assert root is not None
+
+        host, port = get_server_config()
+        client = IggyClient(f"{host}:{port}")
+        await client.connect()
+        identity = await client.login_user("iggy", "iggy")
+
+        assert isinstance(identity, IdentityInfo)
+        assert identity.user_id == root.id
+        assert identity.access_token is None
+
+    @pytest.mark.asyncio
+    async def test_login_with_personal_access_token(self, 
personal_access_token):
+        """Test PAT login with a token minted out of band."""

Review Comment:
   By “out of band,” I meant that the PAT was created directly through the HTTP 
API because PAT creation is not exposed by the Python SDK in this issue. I 
replaced the wording with “created directly through HTTP” in the test and 
“created separately” in the API documentation.



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