mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-04-25 11:18:22 +00:00
fix(test): enable memory config in test_memory_queue_user_isolation
The queue.add() method early-returns when config.memory.enabled is false. With the refactored AppConfig.current() default, memory is disabled, so these tests have to mock it explicitly.
This commit is contained in:
parent
4df595b033
commit
e7bb1e9c54
@ -1,7 +1,19 @@
|
||||
"""Tests for user_id propagation through memory queue."""
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from deerflow.agents.memory.queue import ConversationContext, MemoryUpdateQueue
|
||||
from deerflow.config.app_config import AppConfig
|
||||
from deerflow.config.memory_config import MemoryConfig
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _enable_memory(monkeypatch):
|
||||
"""Ensure MemoryUpdateQueue.add() doesn't early-return on disabled memory."""
|
||||
config = MagicMock(spec=AppConfig)
|
||||
config.memory = MemoryConfig(enabled=True)
|
||||
monkeypatch.setattr(AppConfig, "current", staticmethod(lambda: config))
|
||||
|
||||
|
||||
def test_conversation_context_has_user_id():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user