Files
FabledScribe/tests/test_briefing_pipeline.py
T
2026-03-11 20:07:05 -04:00

30 lines
1.3 KiB
Python

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")