mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-02 19:55:18 +02:00
refactor(gateway): model external chat surfaces over canonical chats
This commit is contained in:
parent
afcadfb4bf
commit
2a41a157f7
4 changed files with 64 additions and 36 deletions
|
|
@ -0,0 +1,16 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from app.tasks.celery_tasks import gateway_tasks
|
||||
|
||||
|
||||
def test_enqueue_received_sweep_is_noop_guard(mocker):
|
||||
apply_async = mocker.Mock()
|
||||
mocker.patch.object(gateway_tasks.process_inbound_event_task, "apply_async", apply_async)
|
||||
info = mocker.patch.object(gateway_tasks.logger, "info")
|
||||
|
||||
replayed = gateway_tasks.enqueue_received_sweep_task.run()
|
||||
|
||||
apply_async.assert_not_called()
|
||||
assert replayed == 0
|
||||
info.assert_called_once()
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from app.tasks.celery_tasks import gateway_tasks
|
||||
|
||||
|
||||
def test_process_inbound_event_task_is_noop_guard(mocker):
|
||||
warning = mocker.patch.object(gateway_tasks.logger, "warning")
|
||||
|
||||
assert gateway_tasks.process_inbound_event_task.run(123) is None
|
||||
|
||||
warning.assert_called_once()
|
||||
assert "FastAPI owns external chat agent turn processing" in warning.call_args.args[0]
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue