fix(i-c): BUG-024 behoben — Plugin-Detail-Endpoint GET /api/v1/plugins/{name} implementiert (Manifest-Metadaten + DB-Status, 404 für unbekannte); Beweistest test_plugin_detail.py 2/2 grün; Existenzprüfung vorher: Route fehlte komplett (bewiesen), Frontend-Nutzung niedrig aber API-Vollständigkeit hergestellt
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
"""Tests for the plugin detail endpoint (BUG-024 fix).
|
||||
|
||||
Proves GET /api/v1/plugins/{name} returns manifest+status detail for known
|
||||
plugins and 404 for unknown ones.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from tests.conftest import ORIGIN_HEADER, login_client, seed_tenant_and_users
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_plugin_detail_returns_manifest_and_status(
|
||||
client, db_session
|
||||
):
|
||||
"""GET /api/v1/plugins/calendar -> 200 with manifest metadata + status."""
|
||||
await seed_tenant_and_users(db_session)
|
||||
await login_client(client, "admin@tenanta.com")
|
||||
|
||||
resp = await client.get("/api/v1/plugins/calendar", headers=ORIGIN_HEADER)
|
||||
assert resp.status_code == 200, resp.text
|
||||
data = resp.json()
|
||||
assert data["name"] == "calendar"
|
||||
assert "status" in data and "installed" in data["status"]
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_plugin_detail_unknown_plugin_returns_404(client, db_session):
|
||||
"""GET /api/v1/plugins/__unknown__ -> 404 not_found."""
|
||||
await seed_tenant_and_users(db_session)
|
||||
await login_client(client, "admin@tenanta.com")
|
||||
|
||||
resp = await client.get("/api/v1/plugins/__unknown_plugin_xyz__", headers=ORIGIN_HEADER)
|
||||
assert resp.status_code == 404, resp.text
|
||||
Reference in New Issue
Block a user