from app.service.memory_service import MemoryService def test_memory_extraction_policy() -> None: assert MemoryService.should_extract_memory( conversation_content="我的风险偏好是稳健", role="user" ) assert not MemoryService.should_extract_memory(conversation_content="", role="user") assert MemoryService.should_extract_memory( conversation_content="completed", role="system", event_type="trade.completed" )