Backend upload-automation file

This commit is contained in:
sriram
2026-08-31 14:59:14 +05:30
parent 3b1352b99d
commit 3df2dc5991
9 changed files with 569 additions and 103 deletions

View File

@@ -109,6 +109,25 @@ def _reset_login_throttle():
auth_router._failures.clear()
@pytest.fixture
def review_inbox_mode(monkeypatch):
"""Pin POST /api/uploads/catalog to the review-inbox path.
`UPLOAD_AUTORUN` ships true, so an upload now runs the pipeline on arrival.
The inbox is still a supported mode - it is exactly what setting the flag
false turns back on - and the modules covering it declare this fixture
autouse, so their subject is stated rather than inherited from whatever the
default happens to be on the day.
Patched on the ROUTER module, not on settings: the handler reads the name
out of its own globals at call time, which is the idiom batch_common's
docstring describes for the BATCH_* limits.
"""
from app.api.routers import uploads
monkeypatch.setattr(uploads, "UPLOAD_AUTORUN", False)
def _token(client: TestClient, username: str, password: str) -> str:
resp = client.post("/api/auth/login", json={"username": username, "password": password})
assert resp.status_code == 200, resp.text