test: lift coverage 41% → 76% (+1068 tests across 36 files)

Service-level tests now exercise provider, permissions, project, journal,
messaging, work_session, metrics, kanban, extraction, learning, notification,
dashboard, llm_routing, a2a, task, repository_base, audit, db_seed,
branch_name, indexed_document, query_helpers, agent. API route tests cover
provider, journal, project, sessions, dashboard, work_session, tasks, a2a,
groups, notifications, agents, channels, messages, kanban, api_resources.
Pure-function helpers covered: handlers, deps_helpers, middleware,
middleware_docs, transcription, pr templates, agents_config, errors,
logging, journal/notification/channel/a2a access, task_lifecycle,
streaming, converters, crypto, schemas (common + websocket), events,
permissions extras.

pyproject ruff per-file-ignores extended for tests so PLR2004 (status code
magic values), PLC0415 (lazy imports), PLR0913 (fixture params), ARG001
(unused fixture deps), SIM105, and E501 don't fight test idioms.
This commit is contained in:
Renn F
2026-05-06 00:32:52 +02:00
parent b6903490f1
commit 64c48356d0
46 changed files with 2994 additions and 206 deletions
+4 -10
View File
@@ -12,7 +12,7 @@ from httpx import ASGITransport, AsyncClient
from roboco.api.deps import get_agent_context, get_db
from roboco.api.routes.dashboard import router as dashboard_router
from roboco.db.tables import AgentTable
from roboco.models import AgentRole, AgentStatus, Team
from roboco.models import AgentRole, AgentStatus
from roboco.models.permissions import AgentContext
from roboco.services.dashboard import reset_storage
@@ -83,9 +83,7 @@ async def test_create_auditor_flag(dashboard_client: AsyncClient) -> None:
@pytest.mark.asyncio
async def test_get_auditor_flags(dashboard_client: AsyncClient) -> None:
response = await dashboard_client.get(
"/api/dashboard/auditor/flags", headers=_HDR
)
response = await dashboard_client.get("/api/dashboard/auditor/flags", headers=_HDR)
assert response.status_code == 200
assert isinstance(response.json(), list)
@@ -154,16 +152,12 @@ async def test_get_kanban_for_team_known_bug(
raising AttributeError. We assert the bug exists so a fix flips the test.
"""
with pytest.raises(AttributeError, match="'str' object has no attribute 'value'"):
await dashboard_client.get(
"/api/dashboard/kanban/backend", headers=_HDR
)
await dashboard_client.get("/api/dashboard/kanban/backend", headers=_HDR)
@pytest.mark.asyncio
async def test_get_all_agent_status(dashboard_client: AsyncClient) -> None:
response = await dashboard_client.get(
"/api/dashboard/agents/status", headers=_HDR
)
response = await dashboard_client.get("/api/dashboard/agents/status", headers=_HDR)
assert response.status_code == 200