Tidy beta landing page and qBittorrent status
Magent CI/CD / verify (push) Successful in 11m0s
Magent CI/CD / deploy-prod (push) Has been skipped
Magent CI/CD / deploy-beta (push) Successful in 15s

This commit is contained in:
2026-06-21 12:06:38 +12:00
parent e6b4f99ea7
commit e163920e21
5 changed files with 217 additions and 82 deletions
+14
View File
@@ -3,6 +3,7 @@ import tempfile
import unittest
from unittest.mock import AsyncMock, patch
import httpx
from fastapi import HTTPException
from starlette.requests import Request
@@ -97,6 +98,19 @@ class NetworkSecurityTests(unittest.TestCase):
class ServiceStatusTests(unittest.IsolatedAsyncioTestCase):
async def test_qbittorrent_login_accepts_modern_empty_response_with_session_cookie(self) -> None:
class FakeClient:
def __init__(self) -> None:
self.cookies = httpx.Cookies()
async def post(self, *_args, **_kwargs) -> httpx.Response:
self.cookies.set("QBT_SID_8080", "session")
return httpx.Response(204, request=httpx.Request("POST", "http://10.0.0.2:8080/api/v2/auth/login"))
client = status_router.QBittorrentClient("http://10.0.0.2:8080", "admin", "secret")
await client._login(FakeClient())
async def test_qbittorrent_incomplete_credentials_report_degraded_when_reachable(self) -> None:
client = status_router.QBittorrentClient("http://10.0.0.2:8080", "admin", None)
with patch.object(client, "is_webui_reachable", new=AsyncMock(return_value=True)):