fix(dms): 3 von 4 Vorbestand-Testfailures behoben — Suite 125->128 gruen
Check Cross-Plugin Imports / check (push) Has been cancelled
Check Cross-Plugin Imports / check (push) Has been cancelled
1. shared_with_me Leerpfad gab Envelope {items,total} zurueck waehrend Erfolgspfad pures Array liefert (self-inconsistent) -> jetzt konsistent [] wie /search; Frontend dms.ts vertraegt beide Shapes
2+3. CHUNK_SIZE historischer Kontrakt wiederhergestellt: Originaltest importierte CHUNK_SIZE aus dms.routes (727d866), a614ab3 entfernte den Import statt das Symbol zu liefern -> NameError x2. Jetzt: oeffentliche Konstante in common.py + Re-Export + Importzeile im Test restauriert
Beweis: Full-DMS-Suite 129 Tests = 128 passed + 1 failed (nur multiple_files, s. Follow-up) vs Baseline 125+4
This commit is contained in:
@@ -106,3 +106,6 @@ def _is_blocked_filetype(filename: str) -> bool:
|
|||||||
chunk_size = 1024 * 1024 # 1MB chunks for streaming uploads
|
chunk_size = 1024 * 1024 # 1MB chunks for streaming uploads
|
||||||
|
|
||||||
# ─── Folders ───
|
# ─── Folders ───
|
||||||
|
|
||||||
|
# Public stream-chunk constant (original contract name from tests/test_p1_6_dms_streaming.py)
|
||||||
|
CHUNK_SIZE = chunk_size
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ from app.deps import get_current_user, require_permission
|
|||||||
from app.plugins.builtins.dms.common import ( # noqa: F401
|
from app.plugins.builtins.dms.common import ( # noqa: F401
|
||||||
ALLOWED_MIME_PREFIXES,
|
ALLOWED_MIME_PREFIXES,
|
||||||
BLOCKED_EXTENSIONS,
|
BLOCKED_EXTENSIONS,
|
||||||
|
CHUNK_SIZE,
|
||||||
MAX_FILE_SIZE,
|
MAX_FILE_SIZE,
|
||||||
OFFICE_EXTENSIONS,
|
OFFICE_EXTENSIONS,
|
||||||
_file_storage_path,
|
_file_storage_path,
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ async def shared_with_me(
|
|||||||
file_ids = {p.file_id for p in perms}
|
file_ids = {p.file_id for p in perms}
|
||||||
|
|
||||||
if not file_ids:
|
if not file_ids:
|
||||||
return {"items": [], "total": 0}
|
return []
|
||||||
|
|
||||||
query = select(DmsFile).where(
|
query = select(DmsFile).where(
|
||||||
DmsFile.tenant_id == tenant_id,
|
DmsFile.tenant_id == tenant_id,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ from unittest.mock import AsyncMock, MagicMock
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from app.core.storage import LocalStorage, StorageBackend
|
from app.core.storage import LocalStorage, StorageBackend
|
||||||
from app.plugins.builtins.dms.routes import _sanitize_filename
|
from app.plugins.builtins.dms.routes import CHUNK_SIZE, _sanitize_filename
|
||||||
|
|
||||||
|
|
||||||
class TestSanitizeFilename:
|
class TestSanitizeFilename:
|
||||||
|
|||||||
Reference in New Issue
Block a user