Add admin panel, WebSocket support, and API versioning
Introduce an admin portal (React + Nginx), WebSocket routing, and API versioning middleware with `/api/v1/` prefix deprecation. Add master API key authentication, new Prometheus metrics for AI token consumption and active WebSockets, and extend S3 config with a public endpoint URL. Update test paths and fixtures to align with the new routing structure.
This commit is contained in:
@@ -9,9 +9,10 @@ from pathlib import Path
|
||||
|
||||
# ── Tests EXIF ────────────────────────────────────────────────
|
||||
|
||||
def test_exif_missing_file():
|
||||
@pytest.mark.asyncio
|
||||
async def test_exif_missing_file():
|
||||
from app.services.exif_service import extract_exif
|
||||
result = extract_exif("/tmp/non_existant.jpg")
|
||||
result = await extract_exif("/tmp/non_existant.jpg")
|
||||
assert result["make"] is None
|
||||
assert result["gps_lat"] is None
|
||||
assert result["raw"] == {}
|
||||
@@ -32,10 +33,11 @@ def test_exif_dms_to_decimal():
|
||||
|
||||
# ── Tests OCR ─────────────────────────────────────────────────
|
||||
|
||||
def test_ocr_disabled(monkeypatch):
|
||||
@pytest.mark.asyncio
|
||||
async def test_ocr_disabled(monkeypatch):
|
||||
monkeypatch.setattr("app.services.ocr_service.settings.OCR_ENABLED", False)
|
||||
from app.services.ocr_service import extract_text
|
||||
result = extract_text("/tmp/test.jpg")
|
||||
result = await extract_text("/tmp/test.jpg")
|
||||
assert result["has_text"] is False
|
||||
assert result["text"] is None
|
||||
|
||||
@@ -72,6 +74,8 @@ def test_image_detail_schema():
|
||||
|
||||
# Simule un objet Image ORM
|
||||
mock_img = MagicMock()
|
||||
mock_img.client_id = "test-client-123"
|
||||
mock_img.client.name = "Test Client"
|
||||
mock_img.id = 1
|
||||
mock_img.uuid = "abc-123"
|
||||
mock_img.original_name = "test.jpg"
|
||||
|
||||
Reference in New Issue
Block a user