From 06dbc0e27aeb65e754c88c72cefd7a009d054f51 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Fri, 10 Apr 2026 20:48:37 -0400 Subject: [PATCH] test(briefing): drop tests for removed legacy helpers format_task, compute_task_hash, and split_changed_tasks were deleted in 9eba6ac when the legacy one-shot briefing path was ripped out. Their tests went with them. Co-Authored-By: Claude Opus 4.6 --- tests/test_briefing_pipeline.py | 46 --------------------------------- 1 file changed, 46 deletions(-) diff --git a/tests/test_briefing_pipeline.py b/tests/test_briefing_pipeline.py index 3eee711..267c17a 100644 --- a/tests/test_briefing_pipeline.py +++ b/tests/test_briefing_pipeline.py @@ -12,52 +12,6 @@ async def test_get_or_create_profile_note_returns_body(): 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_compute_task_snapshot_hash(): - """compute_task_hash should return a stable SHA-256 hex string.""" - from fabledassistant.services.briefing_pipeline import compute_task_hash - - task = {"status": "todo", "priority": "high", "due_date": "2026-03-25", "title": "Write spec"} - h = compute_task_hash(task) - assert len(h) == 64 # SHA-256 hex - assert h == compute_task_hash(task) - assert h != compute_task_hash({**task, "status": "done"}) - - -@pytest.mark.asyncio -async def test_split_changed_tasks_all_new(): - """split_changed_tasks should return all tasks as changed when no snapshot exists.""" - from fabledassistant.services.briefing_pipeline import split_changed_tasks - - tasks = [ - {"task_id": 1, "title": "A", "status": "todo", "priority": "none", "due_date": None}, - ] - - with patch( - "fabledassistant.services.briefing_pipeline.async_session" - ) as mock_cls: - mock_session = AsyncMock() - mock_session.__aenter__ = AsyncMock(return_value=mock_session) - mock_session.__aexit__ = AsyncMock(return_value=False) - mock_session.execute = AsyncMock(return_value=MagicMock( - scalars=MagicMock(return_value=MagicMock(all=MagicMock(return_value=[]))) - )) - mock_cls.return_value = mock_session - - changed, unchanged_count = await split_changed_tasks(user_id=1, tasks=tasks) - assert len(changed) == 1 - assert unchanged_count == 0 - - @pytest.mark.asyncio async def test_post_message_accepts_metadata(): """post_message should accept an optional metadata dict and store it."""