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.
This commit is contained in:
@@ -64,7 +64,11 @@ async def test_create_note_tool_preserves_body_for_knowledge_notes():
|
|||||||
|
|
||||||
async def fake_create_note(**kwargs):
|
async def fake_create_note(**kwargs):
|
||||||
captured.update(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(
|
with patch(
|
||||||
"fabledassistant.services.tools.notes.create_note", new=fake_create_note,
|
"fabledassistant.services.tools.notes.create_note", new=fake_create_note,
|
||||||
|
|||||||
Reference in New Issue
Block a user