test(cron): narrow delivery review to saved-chat routing
This commit is contained in:
1 parent
8691bdedd5
commit
61db036cee
32 files changed
+140
-774
No files matched your search
@@ -12,7 +12,6 @@ try:
|
||||
except ImportError:
|
||||
pytest.skip("Telegram dependencies not installed (python-telegram-bot)", allow_module_level=True)
|
||||
|
||||
from nanobot.bus.delivery import ChannelNotReadyError
|
||||
from nanobot.bus.events import OutboundMessage
|
||||
from nanobot.bus.outbound_events import ProgressEvent
|
||||
from nanobot.bus.queue import MessageBus
|
||||
@@ -622,15 +621,14 @@ async def test_send_during_rebuild_fails_instead_of_dropping(monkeypatch) -> Non
|
||||
channel._app = None
|
||||
|
||||
msg = OutboundMessage(channel="telegram", chat_id="123", content="hello")
|
||||
with pytest.raises(ChannelNotReadyError, match="restarting"):
|
||||
with pytest.raises(RuntimeError, match="restarting"):
|
||||
await channel.send(msg)
|
||||
with pytest.raises(RuntimeError, match="restarting"):
|
||||
await channel.send_delta("123", "hello", stream_id="s1")
|
||||
|
||||
# A stopped channel must not report a final message as delivered.
|
||||
# Stopped: nothing to deliver, so stay quiet.
|
||||
channel._running = False
|
||||
with pytest.raises(ChannelNotReadyError, match="not running"):
|
||||
await channel.send(msg)
|
||||
await channel.send(msg)
|
||||
await channel.send_delta("123", "hello", stream_id="s1")
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user