From 90aa1f2fdb2865cfd4264cdfc60cf2ddaa17510e Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 13 May 2026 12:30:09 -0400 Subject: [PATCH] fix(tests): preserves_body test \$Note stub needs project_id The knowledge-note return path in create_note_tool reads note.project_id; the SimpleNamespace fake didn't define it, so the tool crashed with AttributeError instead of returning. The task-branch test already included project_id; mirror that here. --- tests/test_tools_notes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_tools_notes.py b/tests/test_tools_notes.py index 7512d39..5298b09 100644 --- a/tests/test_tools_notes.py +++ b/tests/test_tools_notes.py @@ -64,7 +64,11 @@ async def test_create_note_tool_preserves_body_for_knowledge_notes(): async def fake_create_note(**kwargs): captured.update(kwargs) - return SimpleNamespace(id=1, title=kwargs["title"], status=None) + # Knowledge-note return path reads note.project_id; SimpleNamespace + # needs the attribute even when it's None. + return SimpleNamespace( + id=1, title=kwargs["title"], status=None, project_id=None, + ) with patch( "fabledassistant.services.tools.notes.create_note", new=fake_create_note,