mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-07-07 02:11:22 +02:00
Move bots into Fanout & Forwarding
This commit is contained in:
@@ -3,9 +3,8 @@
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
import pytest
|
||||
from fastapi import HTTPException
|
||||
|
||||
from app.models import AppSettings, BotConfig
|
||||
from app.models import AppSettings
|
||||
from app.repository import AppSettingsRepository
|
||||
from app.routers.settings import (
|
||||
AppSettingsUpdate,
|
||||
@@ -53,21 +52,6 @@ class TestUpdateSettings:
|
||||
assert isinstance(result, AppSettings)
|
||||
assert result.max_radio_contacts == 200 # default
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_invalid_bot_syntax_returns_400(self):
|
||||
bad_bot = BotConfig(
|
||||
id="bot-1",
|
||||
name="BadBot",
|
||||
enabled=True,
|
||||
code="def bot(:\n return 'x'\n",
|
||||
)
|
||||
|
||||
with pytest.raises(HTTPException) as exc:
|
||||
await update_settings(AppSettingsUpdate(bots=[bad_bot]))
|
||||
|
||||
assert exc.value.status_code == 400
|
||||
assert "syntax error" in exc.value.detail.lower()
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_flood_scope_round_trip(self, test_db):
|
||||
"""Flood scope should be saved and retrieved correctly."""
|
||||
|
||||
Reference in New Issue
Block a user