File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,8 @@ async def mock_server():
175175
176176 # Assert that the custom client info was sent
177177 assert received_client_info == custom_client_info
178+ # Assert that the client info was not replaced with server info after initialization
179+ assert session ._client_info == custom_client_info
178180
179181
180182@pytest .mark .anyio
@@ -183,6 +185,7 @@ async def test_client_session_default_client_info():
183185 server_to_client_send , server_to_client_receive = anyio .create_memory_object_stream [SessionMessage ](1 )
184186
185187 received_client_info = None
188+ received_server_info = None
186189
187190 async def mock_server ():
188191 nonlocal received_client_info
@@ -231,10 +234,13 @@ async def mock_server():
231234 server_to_client_receive ,
232235 ):
233236 tg .start_soon (mock_server )
234- await session .initialize ()
237+ result = await session .initialize ()
238+ received_server_info = result .serverInfo
235239
236240 # Assert that the default client info was sent
237241 assert received_client_info == DEFAULT_CLIENT_INFO
242+ # Assert that the default client info was replaced with server info after initialization
243+ assert session ._client_info == received_server_info
238244
239245
240246@pytest .mark .anyio
You can’t perform that action at this time.
0 commit comments