Skip to content

Commit 3c88e49

Browse files
test: fix errors
1 parent 3f6024e commit 3c88e49

File tree

1 file changed

+2
-29
lines changed

1 file changed

+2
-29
lines changed

tests/unittests/sessions/test_vertex_ai_session_service.py

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -772,33 +772,6 @@ async def test_create_session():
772772

773773
@pytest.mark.asyncio
774774
@pytest.mark.usefixtures('mock_get_api_client')
775-
async def test_create_session_with_custom_session_id_error_handling(mock_api_client_instance):
776-
session_service = mock_vertex_ai_session_service()
777-
778-
# Simulate the LRO bug from Vertex AI API gateway where polling GET fails
779-
mock_api_client_instance.agent_engines.sessions.create.side_effect = ClientError(
780-
code=400,
781-
response_json={
782-
'message': (
783-
'Since the idType "sessions" is not a documented LRO Parent ID,'
784-
' the associated value must be a Long, but was instead:'
785-
' custom-123'
786-
)
787-
},
788-
response=None,
789-
)
790-
791-
session = await session_service.create_session(
792-
app_name='123', user_id='user', session_id='custom-123'
793-
)
794-
assert session.id == 'custom-123'
795-
assert session.user_id == 'user'
796-
assert session.last_update_time is not None
797-
assert session == await session_service.get_session(
798-
app_name='123', user_id='user', session_id=session_id
799-
)
800-
801-
802775
@pytest.mark.parametrize('session_id', ['1', 'abc123'])
803776
async def test_create_session_with_custom_session_id(
804777
mock_api_client_instance: MockAsyncClient, session_id: str
@@ -820,8 +793,8 @@ async def test_create_session_with_custom_session_id(
820793
assert session == await session_service.get_session(
821794
app_name='123', user_id='user', session_id=session_id
822795
)
823-
824-
796+
797+
825798
@pytest.mark.asyncio
826799
@pytest.mark.usefixtures('mock_get_api_client')
827800
async def test_create_session_with_custom_config(mock_api_client_instance):

0 commit comments

Comments
 (0)