Skip to content

Commit fccdee0

Browse files
committed
fix: add LLMFactory mock to test MOS initialization with invalid user
1 parent 96f5f6d commit fccdee0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/mem_os/test_memos_core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,10 @@ def test_mos_init_success(
188188
mock_user_manager.validate_user.assert_called_once_with("test_user")
189189

190190
@patch("memos.mem_os.core.UserManager")
191-
def test_mos_init_invalid_user(self, mock_user_manager_class, mock_config):
191+
@patch("memos.mem_os.core.LLMFactory")
192+
def test_mos_init_invalid_user(self, mock_llm_factory, mock_user_manager_class, mock_config):
192193
"""Test MOS initialization with invalid user."""
194+
mock_llm_factory.from_config.return_value = MagicMock()
193195
mock_user_manager = MagicMock()
194196
mock_user_manager.validate_user.return_value = False
195197
mock_user_manager_class.return_value = mock_user_manager

0 commit comments

Comments
 (0)