···11-# SPDX-License-Identifier: AGPL-3.0-only
22-# Copyright (c) 2026 sol pbc
33-44-"""Unit tests for the todo detector pre-filter hook."""
55-66-from apps.todos.muse.todo_filter import pre_process
77-88-99-class TestTodoFilter:
1010- def test_empty_transcript_skips(self):
1111- result = pre_process({"transcript": ""})
1212- assert result == {"skip_reason": "no commitment signals in transcript"}
1313-1414- def test_missing_transcript_skips(self):
1515- result = pre_process({})
1616- assert result == {"skip_reason": "no commitment signals in transcript"}
1717-1818- def test_none_transcript_skips(self):
1919- result = pre_process({"transcript": None})
2020- assert result == {"skip_reason": "no commitment signals in transcript"}
2121-2222- def test_whitespace_transcript_skips(self):
2323- result = pre_process({"transcript": " \n "})
2424- assert result == {"skip_reason": "no commitment signals in transcript"}
2525-2626- def test_no_signals_skips(self):
2727- result = pre_process({"transcript": "just writing some python code today"})
2828- assert result == {"skip_reason": "no commitment signals in transcript"}
2929-3030- def test_action_commitment_proceeds(self):
3131- result = pre_process({"transcript": "I'll send that email tomorrow"})
3232- assert result is None
3333-3434- def test_follow_up_proceeds(self):
3535- result = pre_process({"transcript": "need to follow up with the team"})
3636- assert result is None
3737-3838- def test_reminder_proceeds(self):
3939- result = pre_process({"transcript": "remind me to check the logs"})
4040- assert result is None
4141-4242- def test_deadline_proceeds(self):
4343- result = pre_process({"transcript": "need to finish this by Monday"})
4444- assert result is None
4545-4646- def test_explicit_marker_proceeds(self):
4747- result = pre_process({"transcript": "TODO: fix the auth flow"})
4848- assert result is None
4949-5050- def test_task_creation_proceeds(self):
5151- result = pre_process({"transcript": "add to my list: buy groceries"})
5252- assert result is None
5353-5454- def test_case_insensitive(self):
5555- result = pre_process({"transcript": "i'll handle it"})
5656- assert result is None
5757-5858- def test_we_should_proceeds(self):
5959- result = pre_process({"transcript": "we should schedule a meeting"})
6060- assert result is None
6161-6262- def test_circle_back_proceeds(self):
6363- result = pre_process({"transcript": "let's circle back on this"})
6464- assert result is None
6565-6666- def test_dont_forget_proceeds(self):
6767- result = pre_process({"transcript": "don't forget to update the docs"})
6868- assert result is None
6969-7070- def test_action_items_proceeds(self):
7171- result = pre_process({"transcript": "here are the action items from today"})
7272- assert result is None
7373-7474- def test_next_steps_proceeds(self):
7575- result = pre_process({"transcript": "the next steps are to review the PR"})
7676- assert result is None