feat: briefing profile note service
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import pytest
|
||||
from unittest.mock import AsyncMock, patch, MagicMock
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_or_create_profile_note_returns_body():
|
||||
"""get_profile_body() should return empty string when no profile note exists."""
|
||||
with patch("fabledassistant.services.briefing_profile.list_notes", new_callable=AsyncMock) as mock_list:
|
||||
mock_list.return_value = ([], 0)
|
||||
from fabledassistant.services.briefing_profile import get_profile_body
|
||||
body = await get_profile_body(user_id=1)
|
||||
assert body == ""
|
||||
|
||||
|
||||
def test_format_task_for_briefing():
|
||||
"""format_task() should return a compact single-line string."""
|
||||
from fabledassistant.services.briefing_pipeline import format_task
|
||||
task = {"title": "Write design doc", "status": "in_progress", "due_date": "2026-03-12", "priority": "high"}
|
||||
result = format_task(task)
|
||||
assert "Write design doc" in result
|
||||
assert "in_progress" in result or "In Progress" in result
|
||||
|
||||
|
||||
def test_slot_greeting():
|
||||
"""slot_greeting() should return different strings for different slot names."""
|
||||
from fabledassistant.services.briefing_pipeline import slot_greeting
|
||||
assert "morning" in slot_greeting("compilation").lower() or slot_greeting("compilation")
|
||||
assert slot_greeting("morning") != slot_greeting("midday")
|
||||
assert slot_greeting("midday") != slot_greeting("afternoon")
|
||||
Reference in New Issue
Block a user