mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
chore: Do not send api request when session does not have events
PiperOrigin-RevId: 775423356
This commit is contained in:
committed by
Copybara-Service
parent
09f1269bf7
commit
88a4402d14
@@ -48,6 +48,13 @@ MOCK_SESSION = Session(
|
||||
],
|
||||
)
|
||||
|
||||
MOCK_SESSION_WITH_EMPTY_EVENTS = Session(
|
||||
app_name=MOCK_APP_NAME,
|
||||
user_id=MOCK_USER_ID,
|
||||
id='444',
|
||||
last_update_time=22333,
|
||||
)
|
||||
|
||||
|
||||
RETRIEVE_MEMORIES_REGEX = r'^reasoningEngines/([^/]+)/memories:retrieve$'
|
||||
GENERATE_MEMORIES_REGEX = r'^reasoningEngines/([^/]+)/memories:generate$'
|
||||
@@ -136,6 +143,15 @@ async def test_add_session_to_memory(mock_get_api_client):
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.usefixtures('mock_get_api_client')
|
||||
async def test_add_empty_session_to_memory(mock_get_api_client):
|
||||
memory_service = mock_vertex_ai_memory_bank_service()
|
||||
await memory_service.add_session_to_memory(MOCK_SESSION_WITH_EMPTY_EVENTS)
|
||||
|
||||
mock_get_api_client.async_request.assert_not_called()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.usefixtures('mock_get_api_client')
|
||||
async def test_search_memory(mock_get_api_client):
|
||||
|
||||
Reference in New Issue
Block a user