Skip to content

Commit 2abefe1

Browse files
committed
Fix client test mock for synchronous json() method
Replace AsyncMock with Mock for response object since httpx response.json() is synchronous, not async. This fixes the TypeError in the client tests.
1 parent 67f1ee3 commit 2abefe1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

agent-memory-client/tests/test_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import asyncio
99
from collections.abc import AsyncGenerator
10-
from unittest.mock import AsyncMock, patch
10+
from unittest.mock import AsyncMock, Mock, patch
1111

1212
import httpx
1313
import pytest
@@ -310,7 +310,7 @@ class TestRecencyConfig:
310310
async def test_recency_config_descriptive_parameters(self, enhanced_test_client):
311311
"""Test that RecencyConfig descriptive parameters are properly sent to API."""
312312
with patch.object(enhanced_test_client._client, "post") as mock_post:
313-
mock_response = AsyncMock()
313+
mock_response = Mock()
314314
mock_response.raise_for_status.return_value = None
315315
mock_response.json.return_value = MemoryRecordResults(
316316
total=0, memories=[], next_offset=None

0 commit comments

Comments
 (0)