Skip to content

Commit b6db891

Browse files
committed
fix: patch correct LLMClient.get_model_config path in test
- Fix test_memory_prompt_with_model_name to patch agent_memory_server.api.LLMClient.get_model_config - Remove commented-out code from tests/conftest.py, tests/test_long_term_memory.py, tests/test_llm_client.py
1 parent 9aafd3d commit b6db891

4 files changed

Lines changed: 1 addition & 47 deletions

File tree

tests/conftest.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@
3333
from agent_memory_server.vectorstore_adapter import VectorStoreAdapter
3434

3535

36-
# from agent_memory_server.utils.redis import ensure_search_index_exists # Not used currently
37-
38-
3936
load_dotenv()
4037

4138

@@ -88,9 +85,6 @@ async def search_index(async_redis_client):
8885
if "unknown index name".lower() not in str(e).lower():
8986
pass
9087

91-
# Skip ensure_search_index_exists for now - let LangChain handle it
92-
# await ensure_search_index_exists(async_redis_client)
93-
9488
except Exception:
9589
raise
9690

tests/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ async def test_memory_prompt_session_not_found(
11031103
assert data["messages"][0]["content"]["text"] == query
11041104

11051105
@patch("agent_memory_server.api.working_memory.get_working_memory")
1106-
@patch("agent_memory_server.api.get_model_config")
1106+
@patch("agent_memory_server.api.LLMClient.get_model_config")
11071107
@pytest.mark.asyncio
11081108
async def test_memory_prompt_with_model_name(
11091109
self, mock_get_model_config, mock_get_working_memory, client

tests/test_llm_client.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -105,39 +105,6 @@ def test_frozen_dataclass(self):
105105

106106

107107
# TODO: Gateway tests disabled pending integration test setup.
108-
# These tests will be re-enabled when gateway functionality is implemented.
109-
# See agent_memory_server/llm/client.py for the gateway design.
110-
#
111-
# class TestLLMClientGatewayConfiguration:
112-
# """Tests for gateway configuration."""
113-
#
114-
# def test_configure_gateway(self):
115-
# """configure_gateway should set gateway URL and API key."""
116-
# LLMClient.configure_gateway(
117-
# base_url="https://gateway.example.com/v1",
118-
# api_key="gateway-key",
119-
# )
120-
# assert LLMClient._gateway_base_url == "https://gateway.example.com/v1"
121-
# assert LLMClient._gateway_api_key == "gateway-key"
122-
#
123-
# def test_reset_gateway(self):
124-
# """reset_gateway should clear gateway configuration."""
125-
# LLMClient.configure_gateway("https://gateway.example.com/v1", "key")
126-
# LLMClient.reset_gateway()
127-
# assert LLMClient._gateway_base_url is None
128-
# assert LLMClient._gateway_api_key is None
129-
#
130-
# def test_reset_clears_all(self):
131-
# """reset() should clear backend and gateway."""
132-
# mock = MockLLMBackend()
133-
# LLMClient.set_backend(mock)
134-
# LLMClient.configure_gateway("https://gateway.example.com/v1", "key")
135-
# LLMClient.reset()
136-
# assert LLMClient._backend is None
137-
# assert LLMClient._gateway_base_url is None
138-
# assert LLMClient._gateway_api_key is None
139-
140-
141108
class TestLLMClientReset:
142109
"""Tests for reset functionality."""
143110

tests/test_long_term_memory.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626
from agent_memory_server.utils.recency import generate_memory_hash
2727

2828

29-
# from agent_memory_server.utils.redis import ensure_search_index_exists # Not used currently
30-
31-
3229
class TestLongTermMemory:
3330
@pytest.mark.asyncio
3431
async def test_index_memories(self, mock_async_redis_client, session):
@@ -752,8 +749,6 @@ class TestLongTermMemoryIntegration:
752749
@pytest.mark.asyncio
753750
async def test_search_messages(self, async_redis_client):
754751
"""Test searching messages"""
755-
# await ensure_search_index_exists(async_redis_client) # Let LangChain handle index
756-
757752
long_term_memories = [
758753
MemoryRecord(
759754
id="memory-1", text="Paris is the capital of France", session_id="123"
@@ -785,8 +780,6 @@ async def test_search_messages(self, async_redis_client):
785780
@pytest.mark.asyncio
786781
async def test_search_messages_with_distance_threshold(self, async_redis_client):
787782
"""Test searching messages with a distance threshold"""
788-
# await ensure_search_index_exists(async_redis_client) # Let LangChain handle index
789-
790783
long_term_memories = [
791784
MemoryRecord(
792785
id="memory-1", text="Paris is the capital of France", session_id="123"

0 commit comments

Comments
 (0)