[Add] Error handling for update method in OSS & platform code. (#1939)
This commit is contained in:
@@ -127,11 +127,15 @@ def test_search(memory_instance, version, enable_graph):
|
||||
|
||||
|
||||
def test_update(memory_instance):
|
||||
memory_instance.embedding_model = Mock()
|
||||
memory_instance.embedding_model.embed = Mock(return_value=[0.1, 0.2, 0.3])
|
||||
|
||||
memory_instance._update_memory = Mock()
|
||||
|
||||
result = memory_instance.update("test_id", "Updated memory")
|
||||
|
||||
memory_instance._update_memory.assert_called_once_with("test_id", "Updated memory")
|
||||
memory_instance._update_memory.assert_called_once_with("test_id", "Updated memory", {"Updated memory": [0.1, 0.2, 0.3]})
|
||||
|
||||
assert result["message"] == "Memory updated successfully!"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user